@agoric/inter-protocol 0.16.1-dev-13050c2.0 → 0.16.1-dev-69236fd.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/README.md +1 -1
- package/bundles/bundle-auctioneer-js-meta.json +116 -116
- package/bundles/bundle-auctioneer.js +1 -1
- package/bundles/bundle-econCommitteeCharter-js-meta.json +73 -73
- package/bundles/bundle-feeDistributor-js-meta.json +57 -57
- package/bundles/bundle-fluxAggregatorKit-js-meta.json +115 -115
- package/bundles/bundle-psm-js-meta.json +109 -109
- package/bundles/bundle-reserve-js-meta.json +108 -108
- package/bundles/bundle-scaledPriceAuthority-js-meta.json +80 -80
- package/bundles/bundle-vaultFactory-js-meta.json +133 -133
- package/bundles/bundle-vaultFactory.js +1 -1
- package/package.json +17 -17
- package/scripts/add-collateral-core.js +2 -2
- package/src/interest-math.js +13 -13
- package/src/interest.js +24 -24
- package/src/proposals/addAssetToVault.js +5 -5
- package/src/vaultFactory/params.js +4 -4
- package/src/vaultFactory/storeUtils.js +11 -7
- package/src/vaultFactory/types.js +4 -4
- package/src/vaultFactory/vault.js +18 -13
- package/src/vaultFactory/vaultManager.js +32 -32
|
@@ -95,16 +95,16 @@ const trace = makeTracer('VM');
|
|
|
95
95
|
|
|
96
96
|
/**
|
|
97
97
|
* @typedef {{
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
98
|
+
* compoundedStabilityFee: Ratio,
|
|
99
|
+
* stabilityFee: Ratio,
|
|
100
|
+
* latestStabilityFeeUpdate: Timestamp,
|
|
101
101
|
* }} AssetState
|
|
102
102
|
*
|
|
103
103
|
* @typedef {{
|
|
104
104
|
* getChargingPeriod: () => RelativeTime,
|
|
105
105
|
* getRecordingPeriod: () => RelativeTime,
|
|
106
106
|
* getDebtLimit: () => Amount<'nat'>,
|
|
107
|
-
*
|
|
107
|
+
* getStabilityFee: () => Ratio,
|
|
108
108
|
* getLiquidationPadding: () => Ratio,
|
|
109
109
|
* getLiquidationMargin: () => Ratio,
|
|
110
110
|
* getLiquidationPenalty: () => Ratio,
|
|
@@ -138,8 +138,8 @@ const trace = makeTracer('VM');
|
|
|
138
138
|
|
|
139
139
|
/**
|
|
140
140
|
* @typedef {{
|
|
141
|
-
*
|
|
142
|
-
*
|
|
141
|
+
* compoundedStabilityFee: Ratio,
|
|
142
|
+
* latestStabilityFeeUpdate: Timestamp,
|
|
143
143
|
* numLiquidationsCompleted: number,
|
|
144
144
|
* numLiquidationsAborted: number,
|
|
145
145
|
* totalCollateral: Amount<'nat'>,
|
|
@@ -230,8 +230,8 @@ export const prepareVaultManagerKit = (
|
|
|
230
230
|
return harden({
|
|
231
231
|
...params,
|
|
232
232
|
...immutable,
|
|
233
|
-
|
|
234
|
-
|
|
233
|
+
compoundedStabilityFee: makeRatio(100n, debtBrand), // starts at 1.0, no interest
|
|
234
|
+
latestStabilityFeeUpdate: startTimeStamp,
|
|
235
235
|
numLiquidationsCompleted: 0,
|
|
236
236
|
numLiquidationsAborted: 0,
|
|
237
237
|
totalCollateral: zeroCollateral,
|
|
@@ -255,7 +255,7 @@ export const prepareVaultManagerKit = (
|
|
|
255
255
|
makeVaultInvitation: M.call().returns(M.promise()),
|
|
256
256
|
getPublicTopics: M.call().returns(TopicsRecordShape),
|
|
257
257
|
getQuotes: M.call().returns(NotifierShape),
|
|
258
|
-
|
|
258
|
+
getCompoundedStabilityFee: M.call().returns(RatioShape),
|
|
259
259
|
}),
|
|
260
260
|
helper: M.interface(
|
|
261
261
|
'helper',
|
|
@@ -276,7 +276,7 @@ export const prepareVaultManagerKit = (
|
|
|
276
276
|
getAssetSubscriber: M.call().returns(SubscriberShape),
|
|
277
277
|
getCollateralBrand: M.call().returns(BrandShape),
|
|
278
278
|
getDebtBrand: M.call().returns(BrandShape),
|
|
279
|
-
|
|
279
|
+
getCompoundedStabilityFee: M.call().returns(RatioShape),
|
|
280
280
|
scopeDescription: M.call(M.string()).returns(M.string()),
|
|
281
281
|
handleBalanceChange: M.call(
|
|
282
282
|
AmountShape,
|
|
@@ -319,8 +319,8 @@ export const prepareVaultManagerKit = (
|
|
|
319
319
|
const ephemera = collateralEphemera(this.state.collateralBrand);
|
|
320
320
|
return ephemera.storedQuotesNotifier;
|
|
321
321
|
},
|
|
322
|
-
|
|
323
|
-
return this.state.
|
|
322
|
+
getCompoundedStabilityFee() {
|
|
323
|
+
return this.state.compoundedStabilityFee;
|
|
324
324
|
},
|
|
325
325
|
getPublicTopics() {
|
|
326
326
|
const { assetTopicKit, metricsTopicKit } = this.state;
|
|
@@ -419,9 +419,9 @@ export const prepareVaultManagerKit = (
|
|
|
419
419
|
updateTime,
|
|
420
420
|
});
|
|
421
421
|
|
|
422
|
-
const
|
|
422
|
+
const stabilityFee = factoryPowers
|
|
423
423
|
.getGovernedParams(collateralBrand)
|
|
424
|
-
.
|
|
424
|
+
.getStabilityFee();
|
|
425
425
|
|
|
426
426
|
// Update state with the results of charging interest
|
|
427
427
|
|
|
@@ -433,7 +433,7 @@ export const prepareVaultManagerKit = (
|
|
|
433
433
|
seatAllocationKeyword: 'Minted',
|
|
434
434
|
},
|
|
435
435
|
{
|
|
436
|
-
|
|
436
|
+
stabilityFee,
|
|
437
437
|
chargingPeriod: factoryPowers
|
|
438
438
|
.getGovernedParams(collateralBrand)
|
|
439
439
|
.getChargingPeriod(),
|
|
@@ -442,15 +442,15 @@ export const prepareVaultManagerKit = (
|
|
|
442
442
|
.getRecordingPeriod(),
|
|
443
443
|
},
|
|
444
444
|
{
|
|
445
|
-
|
|
446
|
-
|
|
445
|
+
latestStabilityFeeUpdate: state.latestStabilityFeeUpdate,
|
|
446
|
+
compoundedStabilityFee: state.compoundedStabilityFee,
|
|
447
447
|
totalDebt: state.totalDebt,
|
|
448
448
|
},
|
|
449
449
|
updateTime,
|
|
450
450
|
);
|
|
451
451
|
|
|
452
|
-
state.
|
|
453
|
-
state.
|
|
452
|
+
state.compoundedStabilityFee = changes.compoundedStabilityFee;
|
|
453
|
+
state.latestStabilityFeeUpdate = changes.latestStabilityFeeUpdate;
|
|
454
454
|
state.totalDebt = changes.totalDebt;
|
|
455
455
|
|
|
456
456
|
return facets.helper.assetNotify();
|
|
@@ -458,14 +458,14 @@ export const prepareVaultManagerKit = (
|
|
|
458
458
|
assetNotify() {
|
|
459
459
|
const { state } = this;
|
|
460
460
|
const { collateralBrand, assetTopicKit } = state;
|
|
461
|
-
const
|
|
461
|
+
const stabilityFee = factoryPowers
|
|
462
462
|
.getGovernedParams(collateralBrand)
|
|
463
|
-
.
|
|
463
|
+
.getStabilityFee();
|
|
464
464
|
/** @type {AssetState} */
|
|
465
465
|
const payload = harden({
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
466
|
+
compoundedStabilityFee: state.compoundedStabilityFee,
|
|
467
|
+
stabilityFee,
|
|
468
|
+
latestStabilityFeeUpdate: state.latestStabilityFeeUpdate,
|
|
469
469
|
});
|
|
470
470
|
return assetTopicKit.recorder.write(payload);
|
|
471
471
|
},
|
|
@@ -843,8 +843,8 @@ export const prepareVaultManagerKit = (
|
|
|
843
843
|
/**
|
|
844
844
|
* coefficient on existing debt to calculate new debt
|
|
845
845
|
*/
|
|
846
|
-
|
|
847
|
-
return this.state.
|
|
846
|
+
getCompoundedStabilityFee() {
|
|
847
|
+
return this.state.compoundedStabilityFee;
|
|
848
848
|
},
|
|
849
849
|
/**
|
|
850
850
|
* Called by a vault when its balances change.
|
|
@@ -1053,7 +1053,7 @@ export const prepareVaultManagerKit = (
|
|
|
1053
1053
|
const { self, helper } = facets;
|
|
1054
1054
|
const {
|
|
1055
1055
|
collateralBrand,
|
|
1056
|
-
|
|
1056
|
+
compoundedStabilityFee,
|
|
1057
1057
|
debtBrand,
|
|
1058
1058
|
liquidatingVaults,
|
|
1059
1059
|
lockedQuote,
|
|
@@ -1082,7 +1082,7 @@ export const prepareVaultManagerKit = (
|
|
|
1082
1082
|
zcf,
|
|
1083
1083
|
{
|
|
1084
1084
|
quote: lockedQuote,
|
|
1085
|
-
interest:
|
|
1085
|
+
interest: compoundedStabilityFee,
|
|
1086
1086
|
margin: liqMargin,
|
|
1087
1087
|
},
|
|
1088
1088
|
prioritizedVaults,
|
|
@@ -1167,11 +1167,11 @@ export const prepareVaultManagerKit = (
|
|
|
1167
1167
|
helper.start();
|
|
1168
1168
|
void state.assetTopicKit.recorder.write(
|
|
1169
1169
|
harden({
|
|
1170
|
-
|
|
1171
|
-
|
|
1170
|
+
compoundedStabilityFee: state.compoundedStabilityFee,
|
|
1171
|
+
stabilityFee: factoryPowers
|
|
1172
1172
|
.getGovernedParams(state.collateralBrand)
|
|
1173
|
-
.
|
|
1174
|
-
|
|
1173
|
+
.getStabilityFee(),
|
|
1174
|
+
latestStabilityFeeUpdate: state.latestStabilityFeeUpdate,
|
|
1175
1175
|
}),
|
|
1176
1176
|
);
|
|
1177
1177
|
|