export function watchQuoteNotifier(notifierP: ERef>, watcher: import("@agoric/swingset-liveslots").PromiseWatcher, ...args: A): Promise; export function prepareVaultManagerKit(baggage: import("@agoric/swingset-liveslots").Baggage, { zcf, marshaller, makeRecorderKit, factoryPowers }: { zcf: import("./vaultFactory.js").VaultFactoryZCF; marshaller: ERef; makeRecorderKit: import("@agoric/zoe/src/contractSupport/recorder.js").MakeRecorderKit; makeERecorderKit: import("@agoric/zoe/src/contractSupport/recorder.js").MakeERecorderKit; factoryPowers: import("./vaultDirector.js").FactoryPowersFacet; }): (externalParams: Omit; collateralBrand: Brand<"nat">; collateralUnit: Amount<"nat">; descriptionScope: string; startTimeStamp: Timestamp; storageNode: StorageNode; }> & { metricsStorageNode: StorageNode; }) => import("@endo/exo").GuardedKit<{ collateral: { makeVaultInvitation(): Promise; storagePath: Promise; }; }; invitationMakers: import("@endo/exo").Guarded<{ AdjustBalances(): Promise>; CloseVault(): Promise>; TransferVault(): Promise>; }>; vault: import("@endo/exo").Guarded<{ getPublicTopics(): { vault: { description: string; subscriber: globalThis.Subscriber; storagePath: Promise; }; }; makeAdjustBalancesInvitation(): Promise>; makeCloseInvitation(): Promise>; makeTransferInvitation(): Promise>; getCollateralAmount(): import("@agoric/ertp").NatAmount; getCurrentDebt(): import("@agoric/ertp").NatAmount; getNormalizedDebt(): NormalizedDebt; }>; vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder; }, undefined>>; getQuotes(): import("@agoric/notifier").StoredNotifier; getCompoundedInterest(): Ratio; getPublicTopics(): { asset: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic; metrics: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic; }; }; helper: { /** Start non-durable processes (or restart if needed after vat restart) */ start(): void; ensureQuoteNotifierWatched(): void; /** @param {Timestamp} updateTime */ chargeAllVaults(updateTime: Timestamp): Promise; assetNotify(): Promise; burnToCoverDebt(debt: any, proceeds: any, seat: any): void; sendToReserve(penalty: any, seat: any, seatKeyword?: string): void; markLiquidating(debt: any, collateral: any): void; /** * @param {Amount<'nat'>} debt * @param {Amount<'nat'>} collateral * @param {Amount<'nat'>} overage * @param {Amount<'nat'>} shortfall */ markDoneLiquidating(debt: Amount<"nat">, collateral: Amount<"nat">, overage: Amount<"nat">, shortfall: Amount<"nat">): void; writeMetrics(): Promise; /** * This is designed to tolerate an incomplete plan, in case * calculateDistributionPlan encounters an error during its calculation. * We don't have a way to induce such errors in CI so we've done so * manually in dev and verified this function recovers as expected. * * @param {AmountKeywordRecord} proceeds * @param {Amount<'nat'>} totalDebt * @param {Pick} oraclePriceAtStart * @param {MapStore< * Vault, * { collateralAmount: Amount<'nat'>; debtAmount: Amount<'nat'> } * >} vaultData * @param {Amount<'nat'>} totalCollateral */ planProceedsDistribution(proceeds: AmountKeywordRecord, totalDebt: Amount<"nat">, oraclePriceAtStart: Pick, vaultData: MapStore; debtAmount: Amount<"nat">; }>, totalCollateral: Amount<"nat">): { plan: import("./proceeds.js").DistributionPlan; vaultsInPlan: import("@endo/exo").Guarded<{ getVaultSeat(): globalThis.ZCFSeat; initVaultKit(seat: ZCFSeat, storageNode: StorageNode): Promise<{ publicSubscribers: { vault: { description: string; subscriber: globalThis.Subscriber; storagePath: Promise; }; }; invitationMakers: import("@endo/exo").Guarded<{ AdjustBalances(): Promise>; CloseVault(): Promise>; TransferVault(): Promise>; }>; vault: import("@endo/exo").Guarded<{ getPublicTopics(): { vault: { description: string; subscriber: globalThis.Subscriber; storagePath: Promise; }; }; makeAdjustBalancesInvitation(): Promise>; makeCloseInvitation(): Promise>; makeTransferInvitation(): Promise>; getCollateralAmount(): import("@agoric/ertp").NatAmount; getCurrentDebt(): import("@agoric/ertp").NatAmount; getNormalizedDebt(): NormalizedDebt; }>; vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder; }>; liquidating(): void; liquidated(): void; abortLiquidation(): string; makeAdjustBalancesInvitation(): Promise>; makeCloseInvitation(): Promise>; makeTransferInvitation(): Promise>; getCollateralAmount(): Amount<"nat">; getCurrentDebt(): Amount<"nat">; getNormalizedDebt(): import("./storeUtils.js").NormalizedDebt; }>[]; }; /** * This is designed to tolerate an incomplete plan, in case * calculateDistributionPlan encounters an error during its calculation. * We don't have a way to induce such errors in CI so we've done so * manually in dev and verified this function recovers as expected. * * @param {object} obj * @param {import('./proceeds.js').DistributionPlan} obj.plan * @param {Vault[]} obj.vaultsInPlan * @param {ZCFSeat} obj.liqSeat * @param {Amount<'nat'>} obj.totalCollateral * @param {Amount<'nat'>} obj.totalDebt * @returns {void} */ distributeProceeds({ plan, vaultsInPlan, liqSeat, totalCollateral, totalDebt, }: { plan: import("./proceeds.js").DistributionPlan; vaultsInPlan: Vault[]; liqSeat: ZCFSeat; totalCollateral: Amount<"nat">; totalDebt: Amount<"nat">; }): void; }; manager: { getGovernedParams(): GovernedParamGetters; /** * Look up the most recent price authority price to determine the max * debt this manager config will allow for the collateral. * * @param {Amount<'nat'>} collateralAmount */ maxDebtFor(collateralAmount: Amount<"nat">): import("@agoric/ertp").NatAmount; mintAndTransfer(mintReceiver: ZCFSeat, toMint: Amount<"nat">, fee: Amount<"nat">, transfers: TransferPart[]): void; /** * @param {Amount<'nat'>} toBurn * @param {ZCFSeat} seat */ burn(toBurn: Amount<"nat">, seat: ZCFSeat): void; getAssetSubscriber(): globalThis.Subscriber; getCollateralBrand(): globalThis.Brand<"nat">; getDebtBrand(): globalThis.Brand<"nat">; /** * Prepend with an identifier of this vault manager * * @param {string} base */ scopeDescription(base: string): string; /** coefficient on existing debt to calculate new debt */ getCompoundedInterest(): Ratio; /** * Called by a vault when its balances change. * * @param {NormalizedDebt} oldDebtNormalized * @param {Amount<'nat'>} oldCollateral * @param {VaultId} vaultId * @param {import('./vault.js').VaultPhase} vaultPhase at the end of * whatever change updated balances * @param {Vault} vault * @returns {void} */ handleBalanceChange(oldDebtNormalized: NormalizedDebt, oldCollateral: Amount<"nat">, vaultId: VaultId, vaultPhase: import("./vault.js").VaultPhase, vault: Vault): void; }; self: { getGovernedParams(): GovernedParamGetters; /** @param {ZCFSeat} seat */ makeVaultKit(seat: ZCFSeat): Promise<{ publicSubscribers: { vault: { description: string; subscriber: globalThis.Subscriber; storagePath: Promise; }; }; invitationMakers: import("@endo/exo").Guarded<{ AdjustBalances(): Promise>; CloseVault(): Promise>; TransferVault(): Promise>; }>; vault: import("@endo/exo").Guarded<{ getPublicTopics(): { vault: { description: string; subscriber: globalThis.Subscriber; storagePath: Promise; }; }; makeAdjustBalancesInvitation(): Promise>; makeCloseInvitation(): Promise>; makeTransferInvitation(): Promise>; getCollateralAmount(): import("@agoric/ertp").NatAmount; getCurrentDebt(): import("@agoric/ertp").NatAmount; getNormalizedDebt(): NormalizedDebt; }>; vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder; }>; getCollateralQuote(): PriceQuote; getPublicFacet(): import("@endo/exo").Guarded<{ makeVaultInvitation(): Promise; storagePath: Promise; }; }; invitationMakers: import("@endo/exo").Guarded<{ AdjustBalances(): Promise>; CloseVault(): Promise>; TransferVault(): Promise>; }>; vault: import("@endo/exo").Guarded<{ getPublicTopics(): { vault: { description: string; subscriber: globalThis.Subscriber; storagePath: Promise; }; }; makeAdjustBalancesInvitation(): Promise>; makeCloseInvitation(): Promise>; makeTransferInvitation(): Promise>; getCollateralAmount(): import("@agoric/ertp").NatAmount; getCurrentDebt(): import("@agoric/ertp").NatAmount; getNormalizedDebt(): NormalizedDebt; }>; vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder; }, undefined>>; getQuotes(): import("@agoric/notifier").StoredNotifier; getCompoundedInterest(): Ratio; getPublicTopics(): { asset: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic; metrics: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic; }; }>; lockOraclePrices(): PriceQuote; /** @param {ERef} auctionPF */ liquidateVaults(auctionPF: ERef): Promise; }; }>>[0], "metricsStorageNode">) => Promise; storagePath: Promise; }; }; invitationMakers: import("@endo/exo").Guarded<{ AdjustBalances(): Promise>; CloseVault(): Promise>; TransferVault(): Promise>; }>; vault: import("@endo/exo").Guarded<{ getPublicTopics(): { vault: { description: string; subscriber: globalThis.Subscriber; storagePath: Promise; }; }; makeAdjustBalancesInvitation(): Promise>; makeCloseInvitation(): Promise>; makeTransferInvitation(): Promise>; getCollateralAmount(): import("@agoric/ertp").NatAmount; getCurrentDebt(): import("@agoric/ertp").NatAmount; getNormalizedDebt(): NormalizedDebt; }>; vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder; }, undefined>>; getQuotes(): import("@agoric/notifier").StoredNotifier; getCompoundedInterest(): Ratio; getPublicTopics(): { asset: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic; metrics: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic; }; }; helper: { /** Start non-durable processes (or restart if needed after vat restart) */ start(): void; ensureQuoteNotifierWatched(): void; /** @param {Timestamp} updateTime */ chargeAllVaults(updateTime: Timestamp): Promise; assetNotify(): Promise; burnToCoverDebt(debt: any, proceeds: any, seat: any): void; sendToReserve(penalty: any, seat: any, seatKeyword?: string): void; markLiquidating(debt: any, collateral: any): void; /** * @param {Amount<'nat'>} debt * @param {Amount<'nat'>} collateral * @param {Amount<'nat'>} overage * @param {Amount<'nat'>} shortfall */ markDoneLiquidating(debt: Amount<"nat">, collateral: Amount<"nat">, overage: Amount<"nat">, shortfall: Amount<"nat">): void; writeMetrics(): Promise; /** * This is designed to tolerate an incomplete plan, in case * calculateDistributionPlan encounters an error during its calculation. * We don't have a way to induce such errors in CI so we've done so * manually in dev and verified this function recovers as expected. * * @param {AmountKeywordRecord} proceeds * @param {Amount<'nat'>} totalDebt * @param {Pick} oraclePriceAtStart * @param {MapStore< * Vault, * { collateralAmount: Amount<'nat'>; debtAmount: Amount<'nat'> } * >} vaultData * @param {Amount<'nat'>} totalCollateral */ planProceedsDistribution(proceeds: AmountKeywordRecord, totalDebt: Amount<"nat">, oraclePriceAtStart: Pick, vaultData: MapStore; debtAmount: Amount<"nat">; }>, totalCollateral: Amount<"nat">): { plan: import("./proceeds.js").DistributionPlan; vaultsInPlan: import("@endo/exo").Guarded<{ getVaultSeat(): globalThis.ZCFSeat; initVaultKit(seat: ZCFSeat, storageNode: StorageNode): Promise<{ publicSubscribers: { vault: { description: string; subscriber: globalThis.Subscriber; storagePath: Promise; }; }; invitationMakers: import("@endo/exo").Guarded<{ AdjustBalances(): Promise>; CloseVault(): Promise>; TransferVault(): Promise>; }>; vault: import("@endo/exo").Guarded<{ getPublicTopics(): { vault: { description: string; subscriber: globalThis.Subscriber; storagePath: Promise; }; }; makeAdjustBalancesInvitation(): Promise>; makeCloseInvitation(): Promise>; makeTransferInvitation(): Promise>; getCollateralAmount(): import("@agoric/ertp").NatAmount; getCurrentDebt(): import("@agoric/ertp").NatAmount; getNormalizedDebt(): NormalizedDebt; }>; vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder; }>; liquidating(): void; liquidated(): void; abortLiquidation(): string; makeAdjustBalancesInvitation(): Promise>; makeCloseInvitation(): Promise>; makeTransferInvitation(): Promise>; getCollateralAmount(): Amount<"nat">; getCurrentDebt(): Amount<"nat">; getNormalizedDebt(): import("./storeUtils.js").NormalizedDebt; }>[]; }; /** * This is designed to tolerate an incomplete plan, in case * calculateDistributionPlan encounters an error during its calculation. * We don't have a way to induce such errors in CI so we've done so * manually in dev and verified this function recovers as expected. * * @param {object} obj * @param {import('./proceeds.js').DistributionPlan} obj.plan * @param {Vault[]} obj.vaultsInPlan * @param {ZCFSeat} obj.liqSeat * @param {Amount<'nat'>} obj.totalCollateral * @param {Amount<'nat'>} obj.totalDebt * @returns {void} */ distributeProceeds({ plan, vaultsInPlan, liqSeat, totalCollateral, totalDebt, }: { plan: import("./proceeds.js").DistributionPlan; vaultsInPlan: Vault[]; liqSeat: ZCFSeat; totalCollateral: Amount<"nat">; totalDebt: Amount<"nat">; }): void; }; manager: { getGovernedParams(): GovernedParamGetters; /** * Look up the most recent price authority price to determine the max * debt this manager config will allow for the collateral. * * @param {Amount<'nat'>} collateralAmount */ maxDebtFor(collateralAmount: Amount<"nat">): import("@agoric/ertp").NatAmount; mintAndTransfer(mintReceiver: ZCFSeat, toMint: Amount<"nat">, fee: Amount<"nat">, transfers: TransferPart[]): void; /** * @param {Amount<'nat'>} toBurn * @param {ZCFSeat} seat */ burn(toBurn: Amount<"nat">, seat: ZCFSeat): void; getAssetSubscriber(): globalThis.Subscriber; getCollateralBrand(): globalThis.Brand<"nat">; getDebtBrand(): globalThis.Brand<"nat">; /** * Prepend with an identifier of this vault manager * * @param {string} base */ scopeDescription(base: string): string; /** coefficient on existing debt to calculate new debt */ getCompoundedInterest(): Ratio; /** * Called by a vault when its balances change. * * @param {NormalizedDebt} oldDebtNormalized * @param {Amount<'nat'>} oldCollateral * @param {VaultId} vaultId * @param {import('./vault.js').VaultPhase} vaultPhase at the end of * whatever change updated balances * @param {Vault} vault * @returns {void} */ handleBalanceChange(oldDebtNormalized: NormalizedDebt, oldCollateral: Amount<"nat">, vaultId: VaultId, vaultPhase: import("./vault.js").VaultPhase, vault: Vault): void; }; self: { getGovernedParams(): GovernedParamGetters; /** @param {ZCFSeat} seat */ makeVaultKit(seat: ZCFSeat): Promise<{ publicSubscribers: { vault: { description: string; subscriber: globalThis.Subscriber; storagePath: Promise; }; }; invitationMakers: import("@endo/exo").Guarded<{ AdjustBalances(): Promise>; CloseVault(): Promise>; TransferVault(): Promise>; }>; vault: import("@endo/exo").Guarded<{ getPublicTopics(): { vault: { description: string; subscriber: globalThis.Subscriber; storagePath: Promise; }; }; makeAdjustBalancesInvitation(): Promise>; makeCloseInvitation(): Promise>; makeTransferInvitation(): Promise>; getCollateralAmount(): import("@agoric/ertp").NatAmount; getCurrentDebt(): import("@agoric/ertp").NatAmount; getNormalizedDebt(): NormalizedDebt; }>; vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder; }>; getCollateralQuote(): PriceQuote; getPublicFacet(): import("@endo/exo").Guarded<{ makeVaultInvitation(): Promise; storagePath: Promise; }; }; invitationMakers: import("@endo/exo").Guarded<{ AdjustBalances(): Promise>; CloseVault(): Promise>; TransferVault(): Promise>; }>; vault: import("@endo/exo").Guarded<{ getPublicTopics(): { vault: { description: string; subscriber: globalThis.Subscriber; storagePath: Promise; }; }; makeAdjustBalancesInvitation(): Promise>; makeCloseInvitation(): Promise>; makeTransferInvitation(): Promise>; getCollateralAmount(): import("@agoric/ertp").NatAmount; getCurrentDebt(): import("@agoric/ertp").NatAmount; getNormalizedDebt(): NormalizedDebt; }>; vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder; }, undefined>>; getQuotes(): import("@agoric/notifier").StoredNotifier; getCompoundedInterest(): Ratio; getPublicTopics(): { asset: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic; metrics: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic; }; }>; lockOraclePrices(): PriceQuote; /** @param {ERef} auctionPF */ liquidateVaults(auctionPF: ERef): Promise; }; }>>; export function provideAndStartVaultManagerKits(baggage: import("@agoric/vat-data").Baggage): { /** @type {(kit: VaultManagerKit) => void} */ add: (kit: VaultManagerKit) => void; /** @type {(index: number) => VaultManagerKit} */ get: (index: number) => VaultManagerKit; length: () => any; }; export type MetricsNotification = { /** * priceQuote that will be used for * liquidation. Non-null from priceLock time until liquidation has taken * place. */ lockedQuote: Ratio | null; /** * present count of vaults */ numActiveVaults: number; /** * present count of liquidating vaults */ numLiquidatingVaults: number; /** * present sum of collateral across * all vaults */ totalCollateral: Amount<"nat">; /** * present sum of debt across all vaults */ totalDebt: Amount<"nat">; /** * collateral held as a result of * not returning excess refunds to owners of vaults liquidated with * shortfalls */ retainedCollateral: Amount<"nat">; /** * present sum of collateral in * vaults sent for liquidation */ liquidatingCollateral: Amount<"nat">; /** * present sum of debt in vaults sent * for liquidation */ liquidatingDebt: Amount<"nat">; /** * running sum of collateral sold * in liquidation */ totalCollateralSold: Amount<"nat">; /** * running sum of overages, * central received greater than debt */ totalOverageReceived: Amount<"nat">; /** * running sum of minted * received from liquidation */ totalProceedsReceived: Amount<"nat">; /** * running sum of shortfalls, * minted received less than debt */ totalShortfallReceived: Amount<"nat">; /** * running count of liquidated * vaults */ numLiquidationsCompleted: number; /** * running count of vault liquidations * that were reverted. */ numLiquidationsAborted: number; }; export type AssetState = { compoundedInterest: Ratio; interestRate: Ratio; latestInterestUpdate: Timestamp; }; export type GovernedParamGetters = { getChargingPeriod: () => RelativeTime; getRecordingPeriod: () => RelativeTime; getDebtLimit: () => Amount<"nat">; getInterestRate: () => Ratio; getLiquidationPadding: () => Ratio; getLiquidationMargin: () => Ratio; getLiquidationPenalty: () => Ratio; getMintFee: () => Ratio; getMinInitialDebt: () => Amount<"nat">; }; export type HeldParams = Readonly<{ debtMint: ZCFMint<"nat">; collateralBrand: Brand<"nat">; collateralUnit: Amount<"nat">; descriptionScope: string; startTimeStamp: Timestamp; storageNode: StorageNode; }>; export type ImmutableState = { assetTopicKit: import("@agoric/zoe/src/contractSupport/recorder.js").RecorderKit; debtBrand: Brand<"nat">; liquidatingVaults: SetStore; metricsTopicKit: import("@agoric/zoe/src/contractSupport/recorder.js").RecorderKit; poolIncrementSeat: ZCFSeat; retainedCollateralSeat: ZCFSeat; unsettledVaults: MapStore; }; export type MutableState = { compoundedInterest: Ratio; latestInterestUpdate: Timestamp; numLiquidationsCompleted: number; numLiquidationsAborted: number; totalCollateral: Amount<"nat">; totalCollateralSold: Amount<"nat">; totalDebt: Amount<"nat">; liquidatingCollateral: Amount<"nat">; liquidatingDebt: Amount<"nat">; totalOverageReceived: Amount<"nat">; totalProceedsReceived: Amount<"nat">; totalShortfallReceived: Amount<"nat">; vaultCounter: number; lockedQuote: PriceQuote | undefined; }; export type VaultManagerKit = EReturn>; /** * Each VaultManager manages a * single collateral type. * * It manages some number of outstanding debt positions, each called a Vault, * for which the collateral is provided in exchange for borrowed Minted. */ export type VaultManager = VaultManagerKit["self"]; export type CollateralManager = VaultManagerKit["collateral"]; import type { ZCFMint } from '@agoric/zoe'; import type { NormalizedDebt } from './storeUtils.js'; import type { PriceQuote } from '@agoric/zoe/tools/types.js'; import type { MapStore } from '@agoric/store'; import type { RelativeTime } from '@agoric/time'; import type { SetStore } from '@agoric/store'; import type { EReturn } from '@endo/far'; //# sourceMappingURL=vaultManager.d.ts.map