@agoric/inter-protocol 0.16.2-upgrade-14-dev-0169c7e.0 → 0.16.2-upgrade-16-dev-8879538.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +41 -34
- package/scripts/build-bundles.js +5 -21
- package/src/auction/auctionBook.d.ts +84 -0
- package/src/auction/auctionBook.d.ts.map +1 -0
- package/src/auction/auctionBook.js +135 -103
- package/src/auction/auctioneer.d.ts +83 -0
- package/src/auction/auctioneer.d.ts.map +1 -0
- package/src/auction/auctioneer.js +63 -49
- package/src/auction/offerBook.d.ts +45 -0
- package/src/auction/offerBook.d.ts.map +1 -0
- package/src/auction/offerBook.js +13 -12
- package/src/auction/params.d.ts +149 -0
- package/src/auction/params.d.ts.map +1 -0
- package/src/auction/params.js +10 -9
- package/src/auction/scheduleMath.d.ts +5 -0
- package/src/auction/scheduleMath.d.ts.map +1 -0
- package/src/auction/scheduleMath.js +17 -15
- package/src/auction/scheduler.d.ts +49 -0
- package/src/auction/scheduler.d.ts.map +1 -0
- package/src/auction/scheduler.js +51 -43
- package/src/auction/sortedOffers.d.ts +8 -0
- package/src/auction/sortedOffers.d.ts.map +1 -0
- package/src/auction/sortedOffers.js +9 -7
- package/src/auction/util.d.ts +32 -0
- package/src/auction/util.d.ts.map +1 -0
- package/src/auction/util.js +6 -4
- package/src/clientSupport.d.ts +167 -0
- package/src/clientSupport.d.ts.map +1 -0
- package/src/clientSupport.js +97 -40
- package/src/collectFees.d.ts +2 -0
- package/src/collectFees.d.ts.map +1 -0
- package/src/contractSupport.d.ts +28 -0
- package/src/contractSupport.d.ts.map +1 -0
- package/src/contractSupport.js +14 -12
- package/src/econCommitteeCharter.d.ts +39 -0
- package/src/econCommitteeCharter.d.ts.map +1 -0
- package/src/econCommitteeCharter.js +21 -20
- package/src/feeDistributor.d.ts +224 -0
- package/src/feeDistributor.d.ts.map +1 -0
- package/src/feeDistributor.js +37 -33
- package/src/index.d.ts +2 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +1 -0
- package/src/interest-math.d.ts +3 -0
- package/src/interest-math.d.ts.map +1 -0
- package/src/interest.d.ts +28 -0
- package/src/interest.d.ts.map +1 -0
- package/src/interest.js +21 -16
- package/src/price/README.md +13 -0
- package/src/price/fluxAggregatorContract.d.ts +70 -0
- package/src/price/fluxAggregatorContract.d.ts.map +1 -0
- package/src/price/fluxAggregatorContract.js +62 -55
- package/src/price/fluxAggregatorKit.d.ts +103 -0
- package/src/price/fluxAggregatorKit.d.ts.map +1 -0
- package/src/price/fluxAggregatorKit.js +50 -37
- package/src/price/priceOracleKit.d.ts +38 -0
- package/src/price/priceOracleKit.d.ts.map +1 -0
- package/src/price/priceOracleKit.js +11 -13
- package/src/price/roundsManager.d.ts +238 -0
- package/src/price/roundsManager.d.ts.map +1 -0
- package/src/price/roundsManager.js +77 -82
- package/src/proposals/README.md +2 -3
- package/src/proposals/add-auction.d.ts +69 -0
- package/src/proposals/add-auction.d.ts.map +1 -0
- package/src/proposals/add-auction.js +181 -0
- package/src/proposals/addAssetToVault.d.ts +160 -0
- package/src/proposals/addAssetToVault.d.ts.map +1 -0
- package/src/proposals/addAssetToVault.js +172 -38
- package/src/proposals/committee-proposal.d.ts +113 -0
- package/src/proposals/committee-proposal.d.ts.map +1 -0
- package/src/proposals/committee-proposal.js +25 -31
- package/src/proposals/core-proposal.d.ts +149 -0
- package/src/proposals/core-proposal.d.ts.map +1 -0
- package/src/proposals/core-proposal.js +9 -11
- package/src/proposals/econ-behaviors.d.ts +1169 -0
- package/src/proposals/econ-behaviors.d.ts.map +1 -0
- package/src/proposals/econ-behaviors.js +66 -45
- package/src/proposals/price-feed-proposal.d.ts +84 -0
- package/src/proposals/price-feed-proposal.d.ts.map +1 -0
- package/src/proposals/price-feed-proposal.js +108 -51
- package/src/proposals/startEconCommittee.d.ts +34 -0
- package/src/proposals/startEconCommittee.d.ts.map +1 -0
- package/src/proposals/startEconCommittee.js +2 -2
- package/src/proposals/startPSM.d.ts +59 -0
- package/src/proposals/startPSM.d.ts.map +1 -0
- package/src/proposals/startPSM.js +38 -27
- package/src/proposals/upgrade-scaledPriceAuthorities.d.ts +24 -0
- package/src/proposals/upgrade-scaledPriceAuthorities.d.ts.map +1 -0
- package/src/proposals/upgrade-scaledPriceAuthorities.js +78 -0
- package/src/proposals/upgrade-vaults.d.ts +35 -0
- package/src/proposals/upgrade-vaults.d.ts.map +1 -0
- package/src/proposals/upgrade-vaults.js +202 -0
- package/src/proposals/utils.d.ts +17 -0
- package/src/proposals/utils.d.ts.map +1 -0
- package/src/proposals/utils.js +34 -7
- package/src/provisionPool.d.ts +167 -0
- package/src/provisionPool.d.ts.map +1 -0
- package/src/provisionPool.js +122 -0
- package/src/provisionPoolKit.d.ts +770 -0
- package/src/provisionPoolKit.d.ts.map +1 -0
- package/src/provisionPoolKit.js +463 -0
- package/src/psm/psm.d.ts +122 -0
- package/src/psm/psm.d.ts.map +1 -0
- package/src/psm/psm.js +73 -69
- package/src/psm/types-ambient.d.ts +2 -0
- package/src/psm/types-ambient.d.ts.map +1 -0
- package/src/psm/types-ambient.js +3 -0
- package/src/reserve/assetReserve.d.ts +47 -0
- package/src/reserve/assetReserve.d.ts.map +1 -0
- package/src/reserve/assetReserve.js +28 -19
- package/src/reserve/assetReserveKit.d.ts +74 -0
- package/src/reserve/assetReserveKit.d.ts.map +1 -0
- package/src/reserve/assetReserveKit.js +18 -24
- package/src/reserve/params.d.ts +10 -0
- package/src/reserve/params.d.ts.map +1 -0
- package/src/tokens.d.ts +3 -0
- package/src/tokens.d.ts.map +1 -0
- package/src/tokens.js +5 -0
- package/src/vaultFactory/burn.d.ts +2 -0
- package/src/vaultFactory/burn.d.ts.map +1 -0
- package/src/vaultFactory/burn.js +1 -1
- package/src/vaultFactory/liquidation.d.ts +163 -0
- package/src/vaultFactory/liquidation.d.ts.map +1 -0
- package/src/vaultFactory/liquidation.js +36 -22
- package/src/vaultFactory/math.d.ts +11 -0
- package/src/vaultFactory/math.d.ts.map +1 -0
- package/src/vaultFactory/math.js +10 -9
- package/src/vaultFactory/orderedVaultStore.d.ts +360 -0
- package/src/vaultFactory/orderedVaultStore.d.ts.map +1 -0
- package/src/vaultFactory/orderedVaultStore.js +8 -11
- package/src/vaultFactory/params.d.ts +145 -0
- package/src/vaultFactory/params.d.ts.map +1 -0
- package/src/vaultFactory/params.js +52 -24
- package/src/vaultFactory/prioritizedVaults.d.ts +992 -0
- package/src/vaultFactory/prioritizedVaults.d.ts.map +1 -0
- package/src/vaultFactory/prioritizedVaults.js +4 -4
- package/src/vaultFactory/proceeds.d.ts +35 -0
- package/src/vaultFactory/proceeds.d.ts.map +1 -0
- package/src/vaultFactory/proceeds.js +26 -18
- package/src/vaultFactory/storeUtils.d.ts +25 -0
- package/src/vaultFactory/storeUtils.d.ts.map +1 -0
- package/src/vaultFactory/storeUtils.js +10 -12
- package/src/vaultFactory/types-ambient.d.ts +234 -0
- package/src/vaultFactory/types-ambient.d.ts.map +1 -0
- package/src/vaultFactory/{types.js → types-ambient.js} +42 -42
- package/src/vaultFactory/vault.d.ts +402 -0
- package/src/vaultFactory/vault.d.ts.map +1 -0
- package/src/vaultFactory/vault.js +99 -93
- package/src/vaultFactory/vaultDirector.d.ts +388 -0
- package/src/vaultFactory/vaultDirector.d.ts.map +1 -0
- package/src/vaultFactory/vaultDirector.js +61 -50
- package/src/vaultFactory/vaultFactory.d.ts +277 -0
- package/src/vaultFactory/vaultFactory.d.ts.map +1 -0
- package/src/vaultFactory/vaultFactory.js +49 -32
- package/src/vaultFactory/vaultHolder.d.ts +270 -0
- package/src/vaultFactory/vaultHolder.d.ts.map +1 -0
- package/src/vaultFactory/vaultHolder.js +10 -14
- package/src/vaultFactory/vaultKit.d.ts +102 -0
- package/src/vaultFactory/vaultKit.d.ts.map +1 -0
- package/src/vaultFactory/vaultKit.js +5 -4
- package/src/vaultFactory/vaultManager.d.ts +819 -0
- package/src/vaultFactory/vaultManager.d.ts.map +1 -0
- package/src/vaultFactory/vaultManager.js +248 -151
- package/CHANGELOG.md +0 -1066
- package/exported.js +0 -2
- package/scripts/add-collateral-core.js +0 -113
- package/scripts/deploy-contracts.js +0 -100
- package/scripts/init-core.js +0 -200
- package/scripts/invite-committee-core.js +0 -42
- package/scripts/manual-price-feed.js +0 -117
- package/scripts/price-feed-core.js +0 -104
- package/scripts/start-local-chain.sh +0 -84
- package/src/psm/types.js +0 -3
- package/src/typeGuards.js +0 -13
- package/src/vaultFactory/type-imports.js +0 -4
|
@@ -0,0 +1,819 @@
|
|
|
1
|
+
export function watchQuoteNotifier<T, A extends any[] = unknown[]>(notifierP: ERef<LatestTopic<T>>, watcher: import("@agoric/swingset-liveslots").PromiseWatcher<T, A>, ...args: A): Promise<void>;
|
|
2
|
+
export function prepareVaultManagerKit(baggage: import("@agoric/swingset-liveslots").Baggage, { zcf, marshaller, makeRecorderKit, factoryPowers }: {
|
|
3
|
+
zcf: import("./vaultFactory.js").VaultFactoryZCF;
|
|
4
|
+
marshaller: ERef<Marshaller>;
|
|
5
|
+
makeRecorderKit: import("@agoric/zoe/src/contractSupport/recorder.js").MakeRecorderKit;
|
|
6
|
+
makeERecorderKit: import("@agoric/zoe/src/contractSupport/recorder.js").MakeERecorderKit;
|
|
7
|
+
factoryPowers: import("./vaultDirector.js").FactoryPowersFacet;
|
|
8
|
+
}): (externalParams: Omit<Readonly<{
|
|
9
|
+
debtMint: ZCFMint<"nat">;
|
|
10
|
+
collateralBrand: Brand<"nat">;
|
|
11
|
+
collateralUnit: Amount<"nat">;
|
|
12
|
+
descriptionScope: string;
|
|
13
|
+
startTimeStamp: Timestamp;
|
|
14
|
+
storageNode: StorageNode;
|
|
15
|
+
}> & {
|
|
16
|
+
metricsStorageNode: StorageNode;
|
|
17
|
+
}, "metricsStorageNode">) => Promise<import("@endo/exo").GuardedKit<{
|
|
18
|
+
collateral: {
|
|
19
|
+
makeVaultInvitation(): Promise<Invitation<{
|
|
20
|
+
publicSubscribers: {
|
|
21
|
+
vault: {
|
|
22
|
+
description: string;
|
|
23
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
24
|
+
storagePath: Promise<string>;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
invitationMakers: import("@endo/exo").Guarded<{
|
|
28
|
+
AdjustBalances(): Promise<Invitation<string, undefined>>;
|
|
29
|
+
CloseVault(): Promise<Invitation<string, undefined>>;
|
|
30
|
+
TransferVault(): Promise<Invitation<any, undefined>>;
|
|
31
|
+
}>;
|
|
32
|
+
vault: import("@endo/exo").Guarded<{
|
|
33
|
+
getPublicTopics(): {
|
|
34
|
+
vault: {
|
|
35
|
+
description: string;
|
|
36
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
37
|
+
storagePath: Promise<string>;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
makeAdjustBalancesInvitation(): Promise<Invitation<string, undefined>>;
|
|
41
|
+
makeCloseInvitation(): Promise<Invitation<string, undefined>>;
|
|
42
|
+
makeTransferInvitation(): Promise<Invitation<any, undefined>>;
|
|
43
|
+
getCollateralAmount(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
44
|
+
getCurrentDebt(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
45
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
46
|
+
}>;
|
|
47
|
+
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<VaultNotification>;
|
|
48
|
+
}, undefined>>;
|
|
49
|
+
getQuotes(): import("@agoric/notifier").StoredNotifier<PriceQuote>;
|
|
50
|
+
getCompoundedInterest(): Ratio;
|
|
51
|
+
getPublicTopics(): {
|
|
52
|
+
asset: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic<AssetState>;
|
|
53
|
+
metrics: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic<MetricsNotification>;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
helper: {
|
|
57
|
+
/** Start non-durable processes (or restart if needed after vat restart) */
|
|
58
|
+
start(): void;
|
|
59
|
+
observeQuoteNotifier(): void;
|
|
60
|
+
/** @param {Timestamp} updateTime */
|
|
61
|
+
chargeAllVaults(updateTime: Timestamp): Promise<void>;
|
|
62
|
+
assetNotify(): Promise<void>;
|
|
63
|
+
burnToCoverDebt(debt: any, proceeds: any, seat: any): void;
|
|
64
|
+
sendToReserve(penalty: any, seat: any, seatKeyword?: string): void;
|
|
65
|
+
markLiquidating(debt: any, collateral: any): void;
|
|
66
|
+
/**
|
|
67
|
+
* @param {Amount<'nat'>} debt
|
|
68
|
+
* @param {Amount<'nat'>} collateral
|
|
69
|
+
* @param {Amount<'nat'>} overage
|
|
70
|
+
* @param {Amount<'nat'>} shortfall
|
|
71
|
+
*/
|
|
72
|
+
markDoneLiquidating(debt: Amount<"nat">, collateral: Amount<"nat">, overage: Amount<"nat">, shortfall: Amount<"nat">): void;
|
|
73
|
+
writeMetrics(): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* This is designed to tolerate an incomplete plan, in case
|
|
76
|
+
* calculateDistributionPlan encounters an error during its calculation.
|
|
77
|
+
* We don't have a way to induce such errors in CI so we've done so
|
|
78
|
+
* manually in dev and verified this function recovers as expected.
|
|
79
|
+
*
|
|
80
|
+
* @param {AmountKeywordRecord} proceeds
|
|
81
|
+
* @param {Amount<'nat'>} totalDebt
|
|
82
|
+
* @param {Pick<PriceQuote, 'quoteAmount'>} oraclePriceAtStart
|
|
83
|
+
* @param {MapStore<
|
|
84
|
+
* Vault,
|
|
85
|
+
* { collateralAmount: Amount<'nat'>; debtAmount: Amount<'nat'> }
|
|
86
|
+
* >} vaultData
|
|
87
|
+
* @param {Amount<'nat'>} totalCollateral
|
|
88
|
+
*/
|
|
89
|
+
planProceedsDistribution(proceeds: AmountKeywordRecord, totalDebt: Amount<"nat">, oraclePriceAtStart: Pick<PriceQuote, "quoteAmount">, vaultData: globalThis.MapStore<import("@endo/exo").Guarded<{
|
|
90
|
+
getVaultSeat(): ZCFSeat;
|
|
91
|
+
initVaultKit(seat: ZCFSeat, storageNode: StorageNode): Promise<{
|
|
92
|
+
publicSubscribers: {
|
|
93
|
+
vault: {
|
|
94
|
+
description: string;
|
|
95
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
96
|
+
storagePath: Promise<string>;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
invitationMakers: import("@endo/exo").Guarded<{
|
|
100
|
+
AdjustBalances(): Promise<Invitation<string, undefined>>;
|
|
101
|
+
CloseVault(): Promise<Invitation<string, undefined>>;
|
|
102
|
+
TransferVault(): Promise<Invitation<any, undefined>>;
|
|
103
|
+
}>;
|
|
104
|
+
vault: import("@endo/exo").Guarded<{
|
|
105
|
+
getPublicTopics(): {
|
|
106
|
+
vault: {
|
|
107
|
+
description: string;
|
|
108
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
109
|
+
storagePath: Promise<string>;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
makeAdjustBalancesInvitation(): Promise<Invitation<string, undefined>>;
|
|
113
|
+
makeCloseInvitation(): Promise<Invitation<string, undefined>>;
|
|
114
|
+
makeTransferInvitation(): Promise<Invitation<any, undefined>>;
|
|
115
|
+
getCollateralAmount(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
116
|
+
getCurrentDebt(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
117
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
118
|
+
}>;
|
|
119
|
+
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<VaultNotification>;
|
|
120
|
+
}>;
|
|
121
|
+
liquidating(): void;
|
|
122
|
+
liquidated(): void;
|
|
123
|
+
abortLiquidation(): string;
|
|
124
|
+
makeAdjustBalancesInvitation(): Promise<Invitation<string, undefined>>;
|
|
125
|
+
makeCloseInvitation(): Promise<Invitation<string, undefined>>;
|
|
126
|
+
makeTransferInvitation(): Promise<Invitation<{
|
|
127
|
+
publicSubscribers: {
|
|
128
|
+
vault: {
|
|
129
|
+
description: string;
|
|
130
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
131
|
+
storagePath: Promise<string>;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
invitationMakers: import("@endo/exo").Guarded<{
|
|
135
|
+
AdjustBalances(): Promise<Invitation<string, undefined>>;
|
|
136
|
+
CloseVault(): Promise<Invitation<string, undefined>>;
|
|
137
|
+
TransferVault(): Promise<Invitation<any, undefined>>;
|
|
138
|
+
}>;
|
|
139
|
+
vault: import("@endo/exo").Guarded<{
|
|
140
|
+
getPublicTopics(): {
|
|
141
|
+
vault: {
|
|
142
|
+
description: string;
|
|
143
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
144
|
+
storagePath: Promise<string>;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
makeAdjustBalancesInvitation(): Promise<Invitation<string, undefined>>;
|
|
148
|
+
makeCloseInvitation(): Promise<Invitation<string, undefined>>;
|
|
149
|
+
makeTransferInvitation(): Promise<Invitation<any, undefined>>;
|
|
150
|
+
getCollateralAmount(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
151
|
+
getCurrentDebt(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
152
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
153
|
+
}>;
|
|
154
|
+
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<VaultNotification>;
|
|
155
|
+
}, undefined>>;
|
|
156
|
+
getCollateralAmount(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
157
|
+
getCurrentDebt(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
158
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
159
|
+
}>, {
|
|
160
|
+
collateralAmount: Amount<"nat">;
|
|
161
|
+
debtAmount: Amount<"nat">;
|
|
162
|
+
}>, totalCollateral: Amount<"nat">): {
|
|
163
|
+
plan: import("./proceeds.js").DistributionPlan;
|
|
164
|
+
vaultsInPlan: import("@endo/exo").Guarded<{
|
|
165
|
+
getVaultSeat(): ZCFSeat;
|
|
166
|
+
initVaultKit(seat: ZCFSeat, storageNode: StorageNode): Promise<{
|
|
167
|
+
publicSubscribers: {
|
|
168
|
+
vault: {
|
|
169
|
+
description: string;
|
|
170
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
171
|
+
storagePath: Promise<string>;
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
invitationMakers: import("@endo/exo").Guarded<{
|
|
175
|
+
AdjustBalances(): Promise<Invitation<string, undefined>>;
|
|
176
|
+
CloseVault(): Promise<Invitation<string, undefined>>;
|
|
177
|
+
TransferVault(): Promise<Invitation<any, undefined>>;
|
|
178
|
+
}>;
|
|
179
|
+
vault: import("@endo/exo").Guarded<{
|
|
180
|
+
getPublicTopics(): {
|
|
181
|
+
vault: {
|
|
182
|
+
description: string;
|
|
183
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
184
|
+
storagePath: Promise<string>;
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
makeAdjustBalancesInvitation(): Promise<Invitation<string, undefined>>;
|
|
188
|
+
makeCloseInvitation(): Promise<Invitation<string, undefined>>;
|
|
189
|
+
makeTransferInvitation(): Promise<Invitation<any, undefined>>;
|
|
190
|
+
getCollateralAmount(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
191
|
+
getCurrentDebt(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
192
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
193
|
+
}>;
|
|
194
|
+
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<VaultNotification>;
|
|
195
|
+
}>;
|
|
196
|
+
liquidating(): void;
|
|
197
|
+
liquidated(): void;
|
|
198
|
+
abortLiquidation(): string;
|
|
199
|
+
makeAdjustBalancesInvitation(): Promise<Invitation<string, undefined>>;
|
|
200
|
+
makeCloseInvitation(): Promise<Invitation<string, undefined>>;
|
|
201
|
+
makeTransferInvitation(): Promise<Invitation<{
|
|
202
|
+
publicSubscribers: {
|
|
203
|
+
vault: {
|
|
204
|
+
description: string;
|
|
205
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
206
|
+
storagePath: Promise<string>;
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
invitationMakers: import("@endo/exo").Guarded<{
|
|
210
|
+
AdjustBalances(): Promise<Invitation<string, undefined>>;
|
|
211
|
+
CloseVault(): Promise<Invitation<string, undefined>>;
|
|
212
|
+
TransferVault(): Promise<Invitation<any, undefined>>;
|
|
213
|
+
}>;
|
|
214
|
+
vault: import("@endo/exo").Guarded<{
|
|
215
|
+
getPublicTopics(): {
|
|
216
|
+
vault: {
|
|
217
|
+
description: string;
|
|
218
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
219
|
+
storagePath: Promise<string>;
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
makeAdjustBalancesInvitation(): Promise<Invitation<string, undefined>>;
|
|
223
|
+
makeCloseInvitation(): Promise<Invitation<string, undefined>>;
|
|
224
|
+
makeTransferInvitation(): Promise<Invitation<any, undefined>>;
|
|
225
|
+
getCollateralAmount(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
226
|
+
getCurrentDebt(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
227
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
228
|
+
}>;
|
|
229
|
+
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<VaultNotification>;
|
|
230
|
+
}, undefined>>;
|
|
231
|
+
getCollateralAmount(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
232
|
+
getCurrentDebt(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
233
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
234
|
+
}>[];
|
|
235
|
+
};
|
|
236
|
+
/**
|
|
237
|
+
* This is designed to tolerate an incomplete plan, in case
|
|
238
|
+
* calculateDistributionPlan encounters an error during its calculation.
|
|
239
|
+
* We don't have a way to induce such errors in CI so we've done so
|
|
240
|
+
* manually in dev and verified this function recovers as expected.
|
|
241
|
+
*
|
|
242
|
+
* @param {object} obj
|
|
243
|
+
* @param {import('./proceeds.js').DistributionPlan} obj.plan
|
|
244
|
+
* @param {Vault[]} obj.vaultsInPlan
|
|
245
|
+
* @param {ZCFSeat} obj.liqSeat
|
|
246
|
+
* @param {Amount<'nat'>} obj.totalCollateral
|
|
247
|
+
* @param {Amount<'nat'>} obj.totalDebt
|
|
248
|
+
* @returns {void}
|
|
249
|
+
*/
|
|
250
|
+
distributeProceeds({ plan, vaultsInPlan, liqSeat, totalCollateral, totalDebt, }: {
|
|
251
|
+
plan: import("./proceeds.js").DistributionPlan;
|
|
252
|
+
vaultsInPlan: import("@endo/exo").Guarded<{
|
|
253
|
+
getVaultSeat(): ZCFSeat;
|
|
254
|
+
initVaultKit(seat: ZCFSeat, storageNode: StorageNode): Promise<{
|
|
255
|
+
publicSubscribers: {
|
|
256
|
+
vault: {
|
|
257
|
+
description: string;
|
|
258
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
259
|
+
storagePath: Promise<string>;
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
invitationMakers: import("@endo/exo").Guarded<{
|
|
263
|
+
AdjustBalances(): Promise<Invitation<string, undefined>>;
|
|
264
|
+
CloseVault(): Promise<Invitation<string, undefined>>;
|
|
265
|
+
TransferVault(): Promise<Invitation<any, undefined>>;
|
|
266
|
+
}>;
|
|
267
|
+
vault: import("@endo/exo").Guarded<{
|
|
268
|
+
getPublicTopics(): {
|
|
269
|
+
vault: {
|
|
270
|
+
description: string;
|
|
271
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
272
|
+
storagePath: Promise<string>;
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
makeAdjustBalancesInvitation(): Promise<Invitation<string, undefined>>;
|
|
276
|
+
makeCloseInvitation(): Promise<Invitation<string, undefined>>;
|
|
277
|
+
makeTransferInvitation(): Promise<Invitation<any, undefined>>;
|
|
278
|
+
getCollateralAmount(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
279
|
+
getCurrentDebt(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
280
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
281
|
+
}>;
|
|
282
|
+
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<VaultNotification>;
|
|
283
|
+
}>;
|
|
284
|
+
liquidating(): void;
|
|
285
|
+
liquidated(): void;
|
|
286
|
+
abortLiquidation(): string;
|
|
287
|
+
makeAdjustBalancesInvitation(): Promise<Invitation<string, undefined>>;
|
|
288
|
+
makeCloseInvitation(): Promise<Invitation<string, undefined>>;
|
|
289
|
+
makeTransferInvitation(): Promise<Invitation<{
|
|
290
|
+
publicSubscribers: {
|
|
291
|
+
vault: {
|
|
292
|
+
description: string;
|
|
293
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
294
|
+
storagePath: Promise<string>;
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
invitationMakers: import("@endo/exo").Guarded<{
|
|
298
|
+
AdjustBalances(): Promise<Invitation<string, undefined>>;
|
|
299
|
+
CloseVault(): Promise<Invitation<string, undefined>>;
|
|
300
|
+
TransferVault(): Promise<Invitation<any, undefined>>;
|
|
301
|
+
}>;
|
|
302
|
+
vault: import("@endo/exo").Guarded<{
|
|
303
|
+
getPublicTopics(): {
|
|
304
|
+
vault: {
|
|
305
|
+
description: string;
|
|
306
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
307
|
+
storagePath: Promise<string>;
|
|
308
|
+
};
|
|
309
|
+
};
|
|
310
|
+
makeAdjustBalancesInvitation(): Promise<Invitation<string, undefined>>;
|
|
311
|
+
makeCloseInvitation(): Promise<Invitation<string, undefined>>;
|
|
312
|
+
makeTransferInvitation(): Promise<Invitation<any, undefined>>;
|
|
313
|
+
getCollateralAmount(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
314
|
+
getCurrentDebt(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
315
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
316
|
+
}>;
|
|
317
|
+
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<VaultNotification>;
|
|
318
|
+
}, undefined>>;
|
|
319
|
+
getCollateralAmount(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
320
|
+
getCurrentDebt(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
321
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
322
|
+
}>[];
|
|
323
|
+
liqSeat: ZCFSeat;
|
|
324
|
+
totalCollateral: Amount<"nat">;
|
|
325
|
+
totalDebt: Amount<"nat">;
|
|
326
|
+
}): void;
|
|
327
|
+
};
|
|
328
|
+
manager: {
|
|
329
|
+
getGovernedParams(): GovernedParamGetters;
|
|
330
|
+
/**
|
|
331
|
+
* Look up the most recent price authority price to determine the max
|
|
332
|
+
* debt this manager config will allow for the collateral.
|
|
333
|
+
*
|
|
334
|
+
* @param {Amount<'nat'>} collateralAmount
|
|
335
|
+
*/
|
|
336
|
+
maxDebtFor(collateralAmount: Amount<"nat">): import("@agoric/ertp/src/types.js").NatAmount;
|
|
337
|
+
/** @type {MintAndTransfer} */
|
|
338
|
+
mintAndTransfer(mintReceiver: ZCFSeat, toMint: Amount<"nat">, fee: Amount<"nat">, transfers: TransferPart[]): void;
|
|
339
|
+
/**
|
|
340
|
+
* @param {Amount<'nat'>} toBurn
|
|
341
|
+
* @param {ZCFSeat} seat
|
|
342
|
+
*/
|
|
343
|
+
burn(toBurn: Amount<"nat">, seat: ZCFSeat): void;
|
|
344
|
+
getAssetSubscriber(): globalThis.Subscriber<AssetState>;
|
|
345
|
+
getCollateralBrand(): globalThis.Brand<"nat">;
|
|
346
|
+
getDebtBrand(): globalThis.Brand<"nat">;
|
|
347
|
+
/**
|
|
348
|
+
* Prepend with an identifier of this vault manager
|
|
349
|
+
*
|
|
350
|
+
* @param {string} base
|
|
351
|
+
*/
|
|
352
|
+
scopeDescription(base: string): string;
|
|
353
|
+
/** coefficient on existing debt to calculate new debt */
|
|
354
|
+
getCompoundedInterest(): Ratio;
|
|
355
|
+
/**
|
|
356
|
+
* Called by a vault when its balances change.
|
|
357
|
+
*
|
|
358
|
+
* @param {NormalizedDebt} oldDebtNormalized
|
|
359
|
+
* @param {Amount<'nat'>} oldCollateral
|
|
360
|
+
* @param {VaultId} vaultId
|
|
361
|
+
* @param {import('./vault.js').VaultPhase} vaultPhase at the end of
|
|
362
|
+
* whatever change updated balances
|
|
363
|
+
* @param {Vault} vault
|
|
364
|
+
* @returns {void}
|
|
365
|
+
*/
|
|
366
|
+
handleBalanceChange(oldDebtNormalized: NormalizedDebt, oldCollateral: Amount<"nat">, vaultId: VaultId, vaultPhase: import("./vault.js").VaultPhase, vault: import("@endo/exo").Guarded<{
|
|
367
|
+
getVaultSeat(): ZCFSeat;
|
|
368
|
+
initVaultKit(seat: ZCFSeat, storageNode: StorageNode): Promise<{
|
|
369
|
+
publicSubscribers: {
|
|
370
|
+
vault: {
|
|
371
|
+
description: string;
|
|
372
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
373
|
+
storagePath: Promise<string>;
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
invitationMakers: import("@endo/exo").Guarded<{
|
|
377
|
+
AdjustBalances(): Promise<Invitation<string, undefined>>;
|
|
378
|
+
CloseVault(): Promise<Invitation<string, undefined>>;
|
|
379
|
+
TransferVault(): Promise<Invitation<any, undefined>>;
|
|
380
|
+
}>;
|
|
381
|
+
vault: import("@endo/exo").Guarded<{
|
|
382
|
+
getPublicTopics(): {
|
|
383
|
+
vault: {
|
|
384
|
+
description: string;
|
|
385
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
386
|
+
storagePath: Promise<string>;
|
|
387
|
+
};
|
|
388
|
+
};
|
|
389
|
+
makeAdjustBalancesInvitation(): Promise<Invitation<string, undefined>>;
|
|
390
|
+
makeCloseInvitation(): Promise<Invitation<string, undefined>>;
|
|
391
|
+
makeTransferInvitation(): Promise<Invitation<any, undefined>>;
|
|
392
|
+
getCollateralAmount(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
393
|
+
getCurrentDebt(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
394
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
395
|
+
}>;
|
|
396
|
+
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<VaultNotification>;
|
|
397
|
+
}>;
|
|
398
|
+
liquidating(): void;
|
|
399
|
+
liquidated(): void;
|
|
400
|
+
abortLiquidation(): string;
|
|
401
|
+
makeAdjustBalancesInvitation(): Promise<Invitation<string, undefined>>;
|
|
402
|
+
makeCloseInvitation(): Promise<Invitation<string, undefined>>;
|
|
403
|
+
makeTransferInvitation(): Promise<Invitation<{
|
|
404
|
+
publicSubscribers: {
|
|
405
|
+
vault: {
|
|
406
|
+
description: string;
|
|
407
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
408
|
+
storagePath: Promise<string>;
|
|
409
|
+
};
|
|
410
|
+
};
|
|
411
|
+
invitationMakers: import("@endo/exo").Guarded<{
|
|
412
|
+
AdjustBalances(): Promise<Invitation<string, undefined>>;
|
|
413
|
+
CloseVault(): Promise<Invitation<string, undefined>>;
|
|
414
|
+
TransferVault(): Promise<Invitation<any, undefined>>;
|
|
415
|
+
}>;
|
|
416
|
+
vault: import("@endo/exo").Guarded<{
|
|
417
|
+
getPublicTopics(): {
|
|
418
|
+
vault: {
|
|
419
|
+
description: string;
|
|
420
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
421
|
+
storagePath: Promise<string>;
|
|
422
|
+
};
|
|
423
|
+
};
|
|
424
|
+
makeAdjustBalancesInvitation(): Promise<Invitation<string, undefined>>;
|
|
425
|
+
makeCloseInvitation(): Promise<Invitation<string, undefined>>;
|
|
426
|
+
makeTransferInvitation(): Promise<Invitation<any, undefined>>;
|
|
427
|
+
getCollateralAmount(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
428
|
+
getCurrentDebt(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
429
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
430
|
+
}>;
|
|
431
|
+
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<VaultNotification>;
|
|
432
|
+
}, undefined>>;
|
|
433
|
+
getCollateralAmount(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
434
|
+
getCurrentDebt(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
435
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
436
|
+
}>): void;
|
|
437
|
+
};
|
|
438
|
+
self: {
|
|
439
|
+
getGovernedParams(): GovernedParamGetters;
|
|
440
|
+
/** @param {ZCFSeat} seat */
|
|
441
|
+
makeVaultKit(seat: ZCFSeat): Promise<{
|
|
442
|
+
publicSubscribers: {
|
|
443
|
+
vault: {
|
|
444
|
+
description: string;
|
|
445
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
446
|
+
storagePath: Promise<string>;
|
|
447
|
+
};
|
|
448
|
+
};
|
|
449
|
+
invitationMakers: import("@endo/exo").Guarded<{
|
|
450
|
+
AdjustBalances(): Promise<Invitation<string, undefined>>;
|
|
451
|
+
CloseVault(): Promise<Invitation<string, undefined>>;
|
|
452
|
+
TransferVault(): Promise<Invitation<any, undefined>>;
|
|
453
|
+
}>;
|
|
454
|
+
vault: import("@endo/exo").Guarded<{
|
|
455
|
+
getPublicTopics(): {
|
|
456
|
+
vault: {
|
|
457
|
+
description: string;
|
|
458
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
459
|
+
storagePath: Promise<string>;
|
|
460
|
+
};
|
|
461
|
+
};
|
|
462
|
+
makeAdjustBalancesInvitation(): Promise<Invitation<string, undefined>>;
|
|
463
|
+
makeCloseInvitation(): Promise<Invitation<string, undefined>>;
|
|
464
|
+
makeTransferInvitation(): Promise<Invitation<any, undefined>>;
|
|
465
|
+
getCollateralAmount(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
466
|
+
getCurrentDebt(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
467
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
468
|
+
}>;
|
|
469
|
+
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<VaultNotification>;
|
|
470
|
+
}>;
|
|
471
|
+
getCollateralQuote(): PriceQuote;
|
|
472
|
+
getPublicFacet(): import("@endo/exo").Guarded<{
|
|
473
|
+
makeVaultInvitation(): Promise<Invitation<{
|
|
474
|
+
publicSubscribers: {
|
|
475
|
+
vault: {
|
|
476
|
+
description: string;
|
|
477
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
478
|
+
storagePath: Promise<string>;
|
|
479
|
+
};
|
|
480
|
+
};
|
|
481
|
+
invitationMakers: import("@endo/exo").Guarded<{
|
|
482
|
+
AdjustBalances(): Promise<Invitation<string, undefined>>;
|
|
483
|
+
CloseVault(): Promise<Invitation<string, undefined>>;
|
|
484
|
+
TransferVault(): Promise<Invitation<any, undefined>>;
|
|
485
|
+
}>;
|
|
486
|
+
vault: import("@endo/exo").Guarded<{
|
|
487
|
+
getPublicTopics(): {
|
|
488
|
+
vault: {
|
|
489
|
+
description: string;
|
|
490
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
491
|
+
storagePath: Promise<string>;
|
|
492
|
+
};
|
|
493
|
+
};
|
|
494
|
+
makeAdjustBalancesInvitation(): Promise<Invitation<string, undefined>>;
|
|
495
|
+
makeCloseInvitation(): Promise<Invitation<string, undefined>>;
|
|
496
|
+
makeTransferInvitation(): Promise<Invitation<any, undefined>>;
|
|
497
|
+
getCollateralAmount(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
498
|
+
getCurrentDebt(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
499
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
500
|
+
}>;
|
|
501
|
+
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<VaultNotification>;
|
|
502
|
+
}, undefined>>;
|
|
503
|
+
getQuotes(): import("@agoric/notifier").StoredNotifier<PriceQuote>;
|
|
504
|
+
getCompoundedInterest(): Ratio;
|
|
505
|
+
getPublicTopics(): {
|
|
506
|
+
asset: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic<AssetState>;
|
|
507
|
+
metrics: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic<MetricsNotification>;
|
|
508
|
+
};
|
|
509
|
+
}>;
|
|
510
|
+
lockOraclePrices(): PriceQuote;
|
|
511
|
+
/** @param {ERef<AuctioneerPublicFacet>} auctionPF */
|
|
512
|
+
liquidateVaults(auctionPF: globalThis.ERef<globalThis.GovernedPublicFacet<{
|
|
513
|
+
getElectorate: () => import("@agoric/ertp/src/types.js").SetAmount<import("@endo/patterns").Key>;
|
|
514
|
+
getStartFrequency: () => RelativeTime;
|
|
515
|
+
getClockStep: () => RelativeTime;
|
|
516
|
+
getStartingRate: () => bigint;
|
|
517
|
+
getLowestRate: () => bigint;
|
|
518
|
+
getDiscountStep: () => bigint;
|
|
519
|
+
getAuctionStartDelay: () => RelativeTime;
|
|
520
|
+
getPriceLockPeriod: () => RelativeTime;
|
|
521
|
+
makeBidInvitation(collateralBrand: Brand<"nat">): Promise<Invitation<string, import("../auction/auctionBook.js").OfferSpec>>;
|
|
522
|
+
getSchedules(): {
|
|
523
|
+
liveAuctionSchedule: import("../auction/scheduler.js").Schedule | null;
|
|
524
|
+
nextAuctionSchedule: import("../auction/scheduler.js").Schedule | null;
|
|
525
|
+
};
|
|
526
|
+
getScheduleUpdates(): globalThis.Subscriber<import("../auction/scheduler.js").ScheduleNotification>;
|
|
527
|
+
getBookDataUpdates(brand: any): globalThis.Subscriber<import("../auction/auctionBook.js").BookDataNotification>;
|
|
528
|
+
getPublicTopics(brand: any): {
|
|
529
|
+
bookData: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic<import("../auction/auctionBook.js").BookDataNotification>;
|
|
530
|
+
} | {
|
|
531
|
+
schedule: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic<import("../auction/scheduler.js").ScheduleNotification>;
|
|
532
|
+
};
|
|
533
|
+
makeDepositInvitation: () => Promise<Invitation<string, {
|
|
534
|
+
goal: import("@agoric/ertp/src/types.js").NatAmount;
|
|
535
|
+
}>>;
|
|
536
|
+
}>>): Promise<void>;
|
|
537
|
+
};
|
|
538
|
+
}>>;
|
|
539
|
+
export function provideAndStartVaultManagerKits(baggage: import("@agoric/vat-data").Baggage): {
|
|
540
|
+
/** @type {(kit: VaultManagerKit) => void} */
|
|
541
|
+
add: (kit: VaultManagerKit) => void;
|
|
542
|
+
/** @type {(index: number) => VaultManagerKit} */
|
|
543
|
+
get: (index: number) => VaultManagerKit;
|
|
544
|
+
length: () => any;
|
|
545
|
+
};
|
|
546
|
+
export type MetricsNotification = {
|
|
547
|
+
/**
|
|
548
|
+
* priceQuote that will be used for
|
|
549
|
+
* liquidation. Non-null from priceLock time until liquidation has taken
|
|
550
|
+
* place.
|
|
551
|
+
*/
|
|
552
|
+
lockedQuote: Ratio | null;
|
|
553
|
+
/**
|
|
554
|
+
* present count of vaults
|
|
555
|
+
*/
|
|
556
|
+
numActiveVaults: number;
|
|
557
|
+
/**
|
|
558
|
+
* present count of liquidating vaults
|
|
559
|
+
*/
|
|
560
|
+
numLiquidatingVaults: number;
|
|
561
|
+
/**
|
|
562
|
+
* present sum of collateral across
|
|
563
|
+
* all vaults
|
|
564
|
+
*/
|
|
565
|
+
totalCollateral: Amount<"nat">;
|
|
566
|
+
/**
|
|
567
|
+
* present sum of debt across all vaults
|
|
568
|
+
*/
|
|
569
|
+
totalDebt: Amount<"nat">;
|
|
570
|
+
/**
|
|
571
|
+
* collateral held as a result of
|
|
572
|
+
* not returning excess refunds to owners of vaults liquidated with
|
|
573
|
+
* shortfalls
|
|
574
|
+
*/
|
|
575
|
+
retainedCollateral: Amount<"nat">;
|
|
576
|
+
/**
|
|
577
|
+
* present sum of collateral in
|
|
578
|
+
* vaults sent for liquidation
|
|
579
|
+
*/
|
|
580
|
+
liquidatingCollateral: Amount<"nat">;
|
|
581
|
+
/**
|
|
582
|
+
* present sum of debt in vaults sent
|
|
583
|
+
* for liquidation
|
|
584
|
+
*/
|
|
585
|
+
liquidatingDebt: Amount<"nat">;
|
|
586
|
+
/**
|
|
587
|
+
* running sum of collateral sold
|
|
588
|
+
* in liquidation
|
|
589
|
+
*/
|
|
590
|
+
totalCollateralSold: Amount<"nat">;
|
|
591
|
+
/**
|
|
592
|
+
* running sum of overages,
|
|
593
|
+
* central received greater than debt
|
|
594
|
+
*/
|
|
595
|
+
totalOverageReceived: Amount<"nat">;
|
|
596
|
+
/**
|
|
597
|
+
* running sum of minted
|
|
598
|
+
* received from liquidation
|
|
599
|
+
*/
|
|
600
|
+
totalProceedsReceived: Amount<"nat">;
|
|
601
|
+
/**
|
|
602
|
+
* running sum of shortfalls,
|
|
603
|
+
* minted received less than debt
|
|
604
|
+
*/
|
|
605
|
+
totalShortfallReceived: Amount<"nat">;
|
|
606
|
+
/**
|
|
607
|
+
* running count of liquidated
|
|
608
|
+
* vaults
|
|
609
|
+
*/
|
|
610
|
+
numLiquidationsCompleted: number;
|
|
611
|
+
/**
|
|
612
|
+
* running count of vault liquidations
|
|
613
|
+
* that were reverted.
|
|
614
|
+
*/
|
|
615
|
+
numLiquidationsAborted: number;
|
|
616
|
+
};
|
|
617
|
+
export type AssetState = {
|
|
618
|
+
compoundedInterest: Ratio;
|
|
619
|
+
interestRate: Ratio;
|
|
620
|
+
latestInterestUpdate: Timestamp;
|
|
621
|
+
};
|
|
622
|
+
export type GovernedParamGetters = {
|
|
623
|
+
getChargingPeriod: () => RelativeTime;
|
|
624
|
+
getRecordingPeriod: () => RelativeTime;
|
|
625
|
+
getDebtLimit: () => Amount<"nat">;
|
|
626
|
+
getInterestRate: () => Ratio;
|
|
627
|
+
getLiquidationPadding: () => Ratio;
|
|
628
|
+
getLiquidationMargin: () => Ratio;
|
|
629
|
+
getLiquidationPenalty: () => Ratio;
|
|
630
|
+
getMintFee: () => Ratio;
|
|
631
|
+
getMinInitialDebt: () => Amount<"nat">;
|
|
632
|
+
};
|
|
633
|
+
export type HeldParams = {
|
|
634
|
+
readonly debtMint: ZCFMint<"nat">;
|
|
635
|
+
readonly collateralBrand: Brand<"nat">;
|
|
636
|
+
readonly collateralUnit: Amount<"nat">;
|
|
637
|
+
readonly descriptionScope: string;
|
|
638
|
+
readonly startTimeStamp: Timestamp;
|
|
639
|
+
readonly storageNode: StorageNode;
|
|
640
|
+
};
|
|
641
|
+
export type ImmutableState = {
|
|
642
|
+
assetTopicKit: import("@agoric/zoe/src/contractSupport/recorder.js").RecorderKit<AssetState>;
|
|
643
|
+
debtBrand: Brand<"nat">;
|
|
644
|
+
liquidatingVaults: globalThis.SetStore<import("@endo/exo").Guarded<{
|
|
645
|
+
getVaultSeat(): ZCFSeat;
|
|
646
|
+
initVaultKit(seat: ZCFSeat, storageNode: StorageNode): Promise<{
|
|
647
|
+
publicSubscribers: {
|
|
648
|
+
vault: {
|
|
649
|
+
description: string;
|
|
650
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
651
|
+
storagePath: Promise<string>;
|
|
652
|
+
};
|
|
653
|
+
};
|
|
654
|
+
invitationMakers: import("@endo/exo").Guarded<{
|
|
655
|
+
AdjustBalances(): Promise<Invitation<string, undefined>>;
|
|
656
|
+
CloseVault(): Promise<Invitation<string, undefined>>;
|
|
657
|
+
TransferVault(): Promise<Invitation<any, undefined>>;
|
|
658
|
+
}>;
|
|
659
|
+
vault: import("@endo/exo").Guarded<{
|
|
660
|
+
getPublicTopics(): {
|
|
661
|
+
vault: {
|
|
662
|
+
description: string;
|
|
663
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
664
|
+
storagePath: Promise<string>;
|
|
665
|
+
};
|
|
666
|
+
};
|
|
667
|
+
makeAdjustBalancesInvitation(): Promise<Invitation<string, undefined>>;
|
|
668
|
+
makeCloseInvitation(): Promise<Invitation<string, undefined>>;
|
|
669
|
+
makeTransferInvitation(): Promise<Invitation<any, undefined>>;
|
|
670
|
+
getCollateralAmount(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
671
|
+
getCurrentDebt(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
672
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
673
|
+
}>;
|
|
674
|
+
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<VaultNotification>;
|
|
675
|
+
}>;
|
|
676
|
+
liquidating(): void;
|
|
677
|
+
liquidated(): void;
|
|
678
|
+
abortLiquidation(): string;
|
|
679
|
+
makeAdjustBalancesInvitation(): Promise<Invitation<string, undefined>>;
|
|
680
|
+
makeCloseInvitation(): Promise<Invitation<string, undefined>>;
|
|
681
|
+
makeTransferInvitation(): Promise<Invitation<{
|
|
682
|
+
publicSubscribers: {
|
|
683
|
+
vault: {
|
|
684
|
+
description: string;
|
|
685
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
686
|
+
storagePath: Promise<string>;
|
|
687
|
+
};
|
|
688
|
+
};
|
|
689
|
+
invitationMakers: import("@endo/exo").Guarded<{
|
|
690
|
+
AdjustBalances(): Promise<Invitation<string, undefined>>;
|
|
691
|
+
CloseVault(): Promise<Invitation<string, undefined>>;
|
|
692
|
+
TransferVault(): Promise<Invitation<any, undefined>>;
|
|
693
|
+
}>;
|
|
694
|
+
vault: import("@endo/exo").Guarded<{
|
|
695
|
+
getPublicTopics(): {
|
|
696
|
+
vault: {
|
|
697
|
+
description: string;
|
|
698
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
699
|
+
storagePath: Promise<string>;
|
|
700
|
+
};
|
|
701
|
+
};
|
|
702
|
+
makeAdjustBalancesInvitation(): Promise<Invitation<string, undefined>>;
|
|
703
|
+
makeCloseInvitation(): Promise<Invitation<string, undefined>>;
|
|
704
|
+
makeTransferInvitation(): Promise<Invitation<any, undefined>>;
|
|
705
|
+
getCollateralAmount(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
706
|
+
getCurrentDebt(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
707
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
708
|
+
}>;
|
|
709
|
+
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<VaultNotification>;
|
|
710
|
+
}, undefined>>;
|
|
711
|
+
getCollateralAmount(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
712
|
+
getCurrentDebt(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
713
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
714
|
+
}>>;
|
|
715
|
+
metricsTopicKit: import("@agoric/zoe/src/contractSupport/recorder.js").RecorderKit<MetricsNotification>;
|
|
716
|
+
poolIncrementSeat: ZCFSeat;
|
|
717
|
+
retainedCollateralSeat: ZCFSeat;
|
|
718
|
+
unsettledVaults: globalThis.MapStore<string, import("@endo/exo").Guarded<{
|
|
719
|
+
getVaultSeat(): ZCFSeat;
|
|
720
|
+
initVaultKit(seat: ZCFSeat, storageNode: StorageNode): Promise<{
|
|
721
|
+
publicSubscribers: {
|
|
722
|
+
vault: {
|
|
723
|
+
description: string;
|
|
724
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
725
|
+
storagePath: Promise<string>;
|
|
726
|
+
};
|
|
727
|
+
};
|
|
728
|
+
invitationMakers: import("@endo/exo").Guarded<{
|
|
729
|
+
AdjustBalances(): Promise<Invitation<string, undefined>>;
|
|
730
|
+
CloseVault(): Promise<Invitation<string, undefined>>;
|
|
731
|
+
TransferVault(): Promise<Invitation<any, undefined>>;
|
|
732
|
+
}>;
|
|
733
|
+
vault: import("@endo/exo").Guarded<{
|
|
734
|
+
getPublicTopics(): {
|
|
735
|
+
vault: {
|
|
736
|
+
description: string;
|
|
737
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
738
|
+
storagePath: Promise<string>;
|
|
739
|
+
};
|
|
740
|
+
};
|
|
741
|
+
makeAdjustBalancesInvitation(): Promise<Invitation<string, undefined>>;
|
|
742
|
+
makeCloseInvitation(): Promise<Invitation<string, undefined>>;
|
|
743
|
+
makeTransferInvitation(): Promise<Invitation<any, undefined>>;
|
|
744
|
+
getCollateralAmount(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
745
|
+
getCurrentDebt(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
746
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
747
|
+
}>;
|
|
748
|
+
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<VaultNotification>;
|
|
749
|
+
}>;
|
|
750
|
+
liquidating(): void;
|
|
751
|
+
liquidated(): void;
|
|
752
|
+
abortLiquidation(): string;
|
|
753
|
+
makeAdjustBalancesInvitation(): Promise<Invitation<string, undefined>>;
|
|
754
|
+
makeCloseInvitation(): Promise<Invitation<string, undefined>>;
|
|
755
|
+
makeTransferInvitation(): Promise<Invitation<{
|
|
756
|
+
publicSubscribers: {
|
|
757
|
+
vault: {
|
|
758
|
+
description: string;
|
|
759
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
760
|
+
storagePath: Promise<string>;
|
|
761
|
+
};
|
|
762
|
+
};
|
|
763
|
+
invitationMakers: import("@endo/exo").Guarded<{
|
|
764
|
+
AdjustBalances(): Promise<Invitation<string, undefined>>;
|
|
765
|
+
CloseVault(): Promise<Invitation<string, undefined>>;
|
|
766
|
+
TransferVault(): Promise<Invitation<any, undefined>>;
|
|
767
|
+
}>;
|
|
768
|
+
vault: import("@endo/exo").Guarded<{
|
|
769
|
+
getPublicTopics(): {
|
|
770
|
+
vault: {
|
|
771
|
+
description: string;
|
|
772
|
+
subscriber: globalThis.Subscriber<VaultNotification>;
|
|
773
|
+
storagePath: Promise<string>;
|
|
774
|
+
};
|
|
775
|
+
};
|
|
776
|
+
makeAdjustBalancesInvitation(): Promise<Invitation<string, undefined>>;
|
|
777
|
+
makeCloseInvitation(): Promise<Invitation<string, undefined>>;
|
|
778
|
+
makeTransferInvitation(): Promise<Invitation<any, undefined>>;
|
|
779
|
+
getCollateralAmount(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
780
|
+
getCurrentDebt(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
781
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
782
|
+
}>;
|
|
783
|
+
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<VaultNotification>;
|
|
784
|
+
}, undefined>>;
|
|
785
|
+
getCollateralAmount(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
786
|
+
getCurrentDebt(): import("@agoric/ertp/src/types.js").NatAmount;
|
|
787
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
788
|
+
}>>;
|
|
789
|
+
};
|
|
790
|
+
export type MutableState = {
|
|
791
|
+
compoundedInterest: Ratio;
|
|
792
|
+
latestInterestUpdate: Timestamp;
|
|
793
|
+
numLiquidationsCompleted: number;
|
|
794
|
+
numLiquidationsAborted: number;
|
|
795
|
+
totalCollateral: Amount<"nat">;
|
|
796
|
+
totalCollateralSold: Amount<"nat">;
|
|
797
|
+
totalDebt: Amount<"nat">;
|
|
798
|
+
liquidatingCollateral: Amount<"nat">;
|
|
799
|
+
liquidatingDebt: Amount<"nat">;
|
|
800
|
+
totalOverageReceived: Amount<"nat">;
|
|
801
|
+
totalProceedsReceived: Amount<"nat">;
|
|
802
|
+
totalShortfallReceived: Amount<"nat">;
|
|
803
|
+
vaultCounter: number;
|
|
804
|
+
lockedQuote: PriceQuote | undefined;
|
|
805
|
+
};
|
|
806
|
+
export type VaultManagerKit = Awaited<ReturnType<ReturnType<typeof prepareVaultManagerKit>>>;
|
|
807
|
+
/**
|
|
808
|
+
* Each VaultManager manages a
|
|
809
|
+
* single collateral type.
|
|
810
|
+
*
|
|
811
|
+
* It manages some number of outstanding debt positions, each called a Vault,
|
|
812
|
+
* for which the collateral is provided in exchange for borrowed Minted.
|
|
813
|
+
*/
|
|
814
|
+
export type VaultManager = VaultManagerKit["self"];
|
|
815
|
+
export type CollateralManager = VaultManagerKit["collateral"];
|
|
816
|
+
import type { NormalizedDebt } from './storeUtils.js';
|
|
817
|
+
import type { PriceQuote } from '@agoric/zoe/tools/types.js';
|
|
818
|
+
import type { RelativeTime } from '@agoric/time';
|
|
819
|
+
//# sourceMappingURL=vaultManager.d.ts.map
|