Skip to content

Commit

Permalink
fixup(liquidationVisibility): Rebase fixes
Browse files Browse the repository at this point in the history
Refs: #35
  • Loading branch information
anilhelvaci committed Jul 15, 2024
1 parent 3699de9 commit 95f8c8e
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 14 deletions.
33 changes: 32 additions & 1 deletion packages/inter-protocol/src/vaultFactory/types-ambient.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,38 @@
* @import {Timestamp} from '@agoric/time'
* @import {TimestampRecord} from '@agoric/time'
* @import {RelativeTime} from '@agoric/time'
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
* @typedef {import('./liquidation.js').VaultData} VaultData
*
* @typedef {import('./proceeds.js').DistributionPlan} DistributionPlan
*/

Expand Down Expand Up @@ -142,6 +173,7 @@
* vaultsInPlan: Array | undefined;
* }} PostAuctionParams
*
*
* @typedef {{
* plan: DistributionPlan | undefined;
* totalCollateral: Amount<'nat'>;
Expand All @@ -151,7 +183,6 @@
*/

/**
*
* @typedef {object} LiquidationVisibilityWriters
* @property {(vaultData: VaultData) => Promise<void>} writePreAuction
* @property {(postAuctionParams: PostAuctionParams) => Promise<void>} writePostAuction
Expand Down
30 changes: 17 additions & 13 deletions packages/inter-protocol/src/vaultFactory/vaultManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ import { calculateMinimumCollateralization, minimumPrice } from './math.js';
import { makePrioritizedVaults } from './prioritizedVaults.js';
import { Phase, prepareVault } from './vault.js';
import { calculateDistributionPlan } from './proceeds.js';
import { AuctionPFShape } from '../auction/auctioneer.js';

/**
* @import {Baggage} from '@agoric/vat-data';
Expand Down Expand Up @@ -175,13 +174,13 @@ export const watchQuoteNotifier = async (notifierP, watcher, ...args) => {

/**
* @typedef {{
* assetTopicKit: import('@agoric/zoe/src/contractSupport/recorder.js').RecorderKit<AssetState>,
* debtBrand: Brand<'nat'>,
* liquidatingVaults: SetStore<Vault>,
* metricsTopicKit: import('@agoric/zoe/src/contractSupport/recorder.js').RecorderKit<MetricsNotification>,
* poolIncrementSeat: ZCFSeat,
* retainedCollateralSeat: ZCFSeat,
* unsettledVaults: MapStore<string, Vault>,
* assetTopicKit: import('@agoric/zoe/src/contractSupport/recorder.js').RecorderKit<AssetState>;
* debtBrand: Brand<'nat'>;
* liquidatingVaults: SetStore<Vault>;
* metricsTopicKit: import('@agoric/zoe/src/contractSupport/recorder.js').RecorderKit<MetricsNotification>;
* poolIncrementSeat: ZCFSeat;
* retainedCollateralSeat: ZCFSeat;
* unsettledVaults: MapStore<string, Vault>;
* }} ImmutableState
*/

Expand Down Expand Up @@ -214,14 +213,15 @@ export const watchQuoteNotifier = async (notifierP, watcher, ...args) => {

/**
* @typedef {{
* error: string
* error: string;
* }} DistributionError
*
* @typedef {(
* | string
* | { collateralAmount: Amount<'nat'>; debtAmount: Amount<'nat'> }
* )[][]} PreAuctionState
*
*
* @typedef {(string | { phase: string })[][]} PostAuctionState
*
* @typedef {{
Expand All @@ -236,10 +236,15 @@ export const watchQuoteNotifier = async (notifierP, watcher, ...args) => {
* startTime?: import('@agoric/time/src/types.js').TimestampRecord | null;
* }} AuctionResultState
*
*
* @typedef {{
* preAuctionRecorderKit: import('@agoric/zoe/src/contractSupport/recorder.js').RecorderKit<PreAuctionState>;
* postAuctionRecorderKit: import('@agoric/zoe/src/contractSupport/recorder.js').RecorderKit<PostAuctionState | DistributionError>;
* auctionResultRecorderKit: import('@agoric/zoe/src/contractSupport/recorder.js').RecorderKit<AuctionResultState | DistributionError>;
* postAuctionRecorderKit: import('@agoric/zoe/src/contractSupport/recorder.js').RecorderKit<
* PostAuctionState | DistributionError
* >;
* auctionResultRecorderKit: import('@agoric/zoe/src/contractSupport/recorder.js').RecorderKit<
* AuctionResultState | DistributionError
* >;
* }} LiquidationRecorderKits
*/

Expand Down Expand Up @@ -430,7 +435,7 @@ export const prepareVaultManagerKit = (
start() {
const { state, facets } = this;
trace(state.collateralBrand, 'helper.start()', state.vaultCounter);
const { collateralBrand, unsettledVaults } = state;
const { collateralBrand, unsettledVaults, storageNode } = state;

const ephemera = collateralEphemera(collateralBrand);
ephemera.prioritizedVaults = makePrioritizedVaults(unsettledVaults);
Expand Down Expand Up @@ -790,7 +795,6 @@ export const prepareVaultManagerKit = (
},

/**
*
* @param {LiquidationVisibilityWriters} liquidationVisibilityWriters
* @returns {boolean}
*/
Expand Down

0 comments on commit 95f8c8e

Please sign in to comment.