@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.
@@ -95,16 +95,16 @@ const trace = makeTracer('VM');
95
95
 
96
96
  /**
97
97
  * @typedef {{
98
- * compoundedInterest: Ratio,
99
- * interestRate: Ratio,
100
- * latestInterestUpdate: Timestamp,
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
- * getInterestRate: () => Ratio,
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
- * compoundedInterest: Ratio,
142
- * latestInterestUpdate: Timestamp,
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
- compoundedInterest: makeRatio(100n, debtBrand), // starts at 1.0, no interest
234
- latestInterestUpdate: startTimeStamp,
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
- getCompoundedInterest: M.call().returns(RatioShape),
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
- getCompoundedInterest: M.call().returns(RatioShape),
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
- getCompoundedInterest() {
323
- return this.state.compoundedInterest;
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 interestRate = factoryPowers
422
+ const stabilityFee = factoryPowers
423
423
  .getGovernedParams(collateralBrand)
424
- .getInterestRate();
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
- interestRate,
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
- latestInterestUpdate: state.latestInterestUpdate,
446
- compoundedInterest: state.compoundedInterest,
445
+ latestStabilityFeeUpdate: state.latestStabilityFeeUpdate,
446
+ compoundedStabilityFee: state.compoundedStabilityFee,
447
447
  totalDebt: state.totalDebt,
448
448
  },
449
449
  updateTime,
450
450
  );
451
451
 
452
- state.compoundedInterest = changes.compoundedInterest;
453
- state.latestInterestUpdate = changes.latestInterestUpdate;
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 interestRate = factoryPowers
461
+ const stabilityFee = factoryPowers
462
462
  .getGovernedParams(collateralBrand)
463
- .getInterestRate();
463
+ .getStabilityFee();
464
464
  /** @type {AssetState} */
465
465
  const payload = harden({
466
- compoundedInterest: state.compoundedInterest,
467
- interestRate,
468
- latestInterestUpdate: state.latestInterestUpdate,
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
- getCompoundedInterest() {
847
- return this.state.compoundedInterest;
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
- compoundedInterest,
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: compoundedInterest,
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
- compoundedInterest: state.compoundedInterest,
1171
- interestRate: factoryPowers
1170
+ compoundedStabilityFee: state.compoundedStabilityFee,
1171
+ stabilityFee: factoryPowers
1172
1172
  .getGovernedParams(state.collateralBrand)
1173
- .getInterestRate(),
1174
- latestInterestUpdate: state.latestInterestUpdate,
1173
+ .getStabilityFee(),
1174
+ latestStabilityFeeUpdate: state.latestStabilityFeeUpdate,
1175
1175
  }),
1176
1176
  );
1177
1177