@agoric/inter-protocol 0.16.2-dev-8bcf6af.0 → 0.16.2-dev-8baf0aa.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.
Files changed (44) hide show
  1. package/README.md +1 -1
  2. package/bundles/bundle-auctioneer-js-meta.json +193 -181
  3. package/bundles/bundle-auctioneer.js +1 -1
  4. package/bundles/bundle-econCommitteeCharter-js-meta.json +141 -129
  5. package/bundles/bundle-econCommitteeCharter.js +1 -1
  6. package/bundles/bundle-feeDistributor-js-meta.json +127 -115
  7. package/bundles/bundle-feeDistributor.js +1 -1
  8. package/bundles/bundle-fluxAggregatorKit-js-meta.json +181 -169
  9. package/bundles/bundle-fluxAggregatorKit.js +1 -1
  10. package/bundles/bundle-psm-js-meta.json +179 -167
  11. package/bundles/bundle-psm.js +1 -1
  12. package/bundles/bundle-reserve-js-meta.json +178 -166
  13. package/bundles/bundle-reserve.js +1 -1
  14. package/bundles/bundle-scaledPriceAuthority-js-meta.json +148 -136
  15. package/bundles/bundle-scaledPriceAuthority.js +1 -1
  16. package/bundles/bundle-vaultFactory-js-meta.json +210 -198
  17. package/bundles/bundle-vaultFactory.js +1 -1
  18. package/package.json +17 -17
  19. package/scripts/add-collateral-core.js +2 -2
  20. package/src/interest-math.d.ts +1 -1
  21. package/src/interest-math.d.ts.map +1 -1
  22. package/src/interest-math.js +13 -13
  23. package/src/interest.d.ts +6 -6
  24. package/src/interest.d.ts.map +1 -1
  25. package/src/interest.js +25 -26
  26. package/src/proposals/addAssetToVault.d.ts +5 -5
  27. package/src/proposals/addAssetToVault.js +5 -5
  28. package/src/vaultFactory/params.d.ts +5 -5
  29. package/src/vaultFactory/params.js +4 -4
  30. package/src/vaultFactory/storeUtils.d.ts +2 -2
  31. package/src/vaultFactory/storeUtils.d.ts.map +1 -1
  32. package/src/vaultFactory/storeUtils.js +7 -11
  33. package/src/vaultFactory/types.d.ts +4 -4
  34. package/src/vaultFactory/types.d.ts.map +1 -1
  35. package/src/vaultFactory/types.js +4 -4
  36. package/src/vaultFactory/vault.d.ts +11 -11
  37. package/src/vaultFactory/vault.d.ts.map +1 -1
  38. package/src/vaultFactory/vault.js +14 -19
  39. package/src/vaultFactory/vaultDirector.d.ts +10 -10
  40. package/src/vaultFactory/vaultFactory.d.ts +4 -4
  41. package/src/vaultFactory/vaultManager.d.ts +38 -38
  42. package/src/vaultFactory/vaultManager.d.ts.map +1 -1
  43. package/src/vaultFactory/vaultManager.js +35 -34
  44. package/CHANGELOG.md +0 -1033
@@ -106,16 +106,16 @@ const trace = makeTracer('VM');
106
106
 
107
107
  /**
108
108
  * @typedef {{
109
- * compoundedStabilityFee: Ratio;
110
- * stabilityFee: Ratio;
111
- * latestStabilityFeeUpdate: Timestamp;
109
+ * compoundedInterest: Ratio;
110
+ * interestRate: Ratio;
111
+ * latestInterestUpdate: Timestamp;
112
112
  * }} AssetState
113
113
  *
114
114
  * @typedef {{
115
115
  * getChargingPeriod: () => RelativeTime;
116
116
  * getRecordingPeriod: () => RelativeTime;
117
117
  * getDebtLimit: () => Amount<'nat'>;
118
- * getStabilityFee: () => Ratio;
118
+ * getInterestRate: () => Ratio;
119
119
  * getLiquidationPadding: () => Ratio;
120
120
  * getLiquidationMargin: () => Ratio;
121
121
  * getLiquidationPenalty: () => Ratio;
@@ -149,8 +149,8 @@ const trace = makeTracer('VM');
149
149
 
150
150
  /**
151
151
  * @typedef {{
152
- * compoundedStabilityFee: Ratio;
153
- * latestStabilityFeeUpdate: Timestamp;
152
+ * compoundedInterest: Ratio;
153
+ * latestInterestUpdate: Timestamp;
154
154
  * numLiquidationsCompleted: number;
155
155
  * numLiquidationsAborted: number;
156
156
  * totalCollateral: Amount<'nat'>;
@@ -242,8 +242,8 @@ export const prepareVaultManagerKit = (
242
242
  return harden({
243
243
  ...params,
244
244
  ...immutable,
245
- compoundedStabilityFee: makeRatio(100n, debtBrand), // starts at 1.0, no interest
246
- latestStabilityFeeUpdate: startTimeStamp,
245
+ compoundedInterest: makeRatio(100n, debtBrand), // starts at 1.0, no interest
246
+ latestInterestUpdate: startTimeStamp,
247
247
  numLiquidationsCompleted: 0,
248
248
  numLiquidationsAborted: 0,
249
249
  totalCollateral: zeroCollateral,
@@ -267,7 +267,7 @@ export const prepareVaultManagerKit = (
267
267
  makeVaultInvitation: M.call().returns(M.promise()),
268
268
  getPublicTopics: M.call().returns(TopicsRecordShape),
269
269
  getQuotes: M.call().returns(NotifierShape),
270
- getCompoundedStabilityFee: M.call().returns(RatioShape),
270
+ getCompoundedInterest: M.call().returns(RatioShape),
271
271
  }),
272
272
  helper: M.interface(
273
273
  'helper',
@@ -288,7 +288,7 @@ export const prepareVaultManagerKit = (
288
288
  getAssetSubscriber: M.call().returns(SubscriberShape),
289
289
  getCollateralBrand: M.call().returns(BrandShape),
290
290
  getDebtBrand: M.call().returns(BrandShape),
291
- getCompoundedStabilityFee: M.call().returns(RatioShape),
291
+ getCompoundedInterest: M.call().returns(RatioShape),
292
292
  scopeDescription: M.call(M.string()).returns(M.string()),
293
293
  handleBalanceChange: M.call(
294
294
  AmountShape,
@@ -331,8 +331,8 @@ export const prepareVaultManagerKit = (
331
331
  const ephemera = collateralEphemera(this.state.collateralBrand);
332
332
  return ephemera.storedQuotesNotifier;
333
333
  },
334
- getCompoundedStabilityFee() {
335
- return this.state.compoundedStabilityFee;
334
+ getCompoundedInterest() {
335
+ return this.state.compoundedInterest;
336
336
  },
337
337
  getPublicTopics() {
338
338
  const { assetTopicKit, metricsTopicKit } = this.state;
@@ -427,9 +427,9 @@ export const prepareVaultManagerKit = (
427
427
  updateTime,
428
428
  });
429
429
 
430
- const stabilityFee = factoryPowers
430
+ const interestRate = factoryPowers
431
431
  .getGovernedParams(collateralBrand)
432
- .getStabilityFee();
432
+ .getInterestRate();
433
433
 
434
434
  // Update state with the results of charging interest
435
435
 
@@ -441,7 +441,7 @@ export const prepareVaultManagerKit = (
441
441
  seatAllocationKeyword: 'Minted',
442
442
  },
443
443
  {
444
- stabilityFee,
444
+ interestRate,
445
445
  chargingPeriod: factoryPowers
446
446
  .getGovernedParams(collateralBrand)
447
447
  .getChargingPeriod(),
@@ -450,15 +450,15 @@ export const prepareVaultManagerKit = (
450
450
  .getRecordingPeriod(),
451
451
  },
452
452
  {
453
- latestStabilityFeeUpdate: state.latestStabilityFeeUpdate,
454
- compoundedStabilityFee: state.compoundedStabilityFee,
453
+ latestInterestUpdate: state.latestInterestUpdate,
454
+ compoundedInterest: state.compoundedInterest,
455
455
  totalDebt: state.totalDebt,
456
456
  },
457
457
  updateTime,
458
458
  );
459
459
 
460
- state.compoundedStabilityFee = changes.compoundedStabilityFee;
461
- state.latestStabilityFeeUpdate = changes.latestStabilityFeeUpdate;
460
+ state.compoundedInterest = changes.compoundedInterest;
461
+ state.latestInterestUpdate = changes.latestInterestUpdate;
462
462
  state.totalDebt = changes.totalDebt;
463
463
 
464
464
  return facets.helper.assetNotify();
@@ -466,14 +466,14 @@ export const prepareVaultManagerKit = (
466
466
  assetNotify() {
467
467
  const { state } = this;
468
468
  const { collateralBrand, assetTopicKit } = state;
469
- const stabilityFee = factoryPowers
469
+ const interestRate = factoryPowers
470
470
  .getGovernedParams(collateralBrand)
471
- .getStabilityFee();
471
+ .getInterestRate();
472
472
  /** @type {AssetState} */
473
473
  const payload = harden({
474
- compoundedStabilityFee: state.compoundedStabilityFee,
475
- stabilityFee,
476
- latestStabilityFeeUpdate: state.latestStabilityFeeUpdate,
474
+ compoundedInterest: state.compoundedInterest,
475
+ interestRate,
476
+ latestInterestUpdate: state.latestInterestUpdate,
477
477
  });
478
478
  return assetTopicKit.recorder.write(payload);
479
479
  },
@@ -853,8 +853,8 @@ export const prepareVaultManagerKit = (
853
853
  return `${descriptionScope}: ${base}`;
854
854
  },
855
855
  /** coefficient on existing debt to calculate new debt */
856
- getCompoundedStabilityFee() {
857
- return this.state.compoundedStabilityFee;
856
+ getCompoundedInterest() {
857
+ return this.state.compoundedInterest;
858
858
  },
859
859
  /**
860
860
  * Called by a vault when its balances change.
@@ -1051,7 +1051,7 @@ export const prepareVaultManagerKit = (
1051
1051
  );
1052
1052
 
1053
1053
  state.lockedQuote = storedCollateralQuote;
1054
- facets.helper.writeMetrics();
1054
+ void facets.helper.writeMetrics();
1055
1055
  return storedCollateralQuote;
1056
1056
  },
1057
1057
  /** @param {ERef<AuctioneerPublicFacet>} auctionPF */
@@ -1060,7 +1060,7 @@ export const prepareVaultManagerKit = (
1060
1060
  const { self, helper } = facets;
1061
1061
  const {
1062
1062
  collateralBrand,
1063
- compoundedStabilityFee,
1063
+ compoundedInterest,
1064
1064
  debtBrand,
1065
1065
  liquidatingVaults,
1066
1066
  lockedQuote,
@@ -1089,7 +1089,7 @@ export const prepareVaultManagerKit = (
1089
1089
  zcf,
1090
1090
  {
1091
1091
  quote: lockedQuote,
1092
- interest: compoundedStabilityFee,
1092
+ interest: compoundedInterest,
1093
1093
  margin: liqMargin,
1094
1094
  },
1095
1095
  prioritizedVaults,
@@ -1101,6 +1101,7 @@ export const prepareVaultManagerKit = (
1101
1101
  state.lockedQuote = undefined;
1102
1102
 
1103
1103
  if (vaultData.getSize() === 0) {
1104
+ void helper.writeMetrics();
1104
1105
  return;
1105
1106
  }
1106
1107
  trace(
@@ -1164,7 +1165,7 @@ export const prepareVaultManagerKit = (
1164
1165
  liquidatingVaults.delete(vault);
1165
1166
  }
1166
1167
 
1167
- await facets.helper.writeMetrics();
1168
+ void helper.writeMetrics();
1168
1169
  },
1169
1170
  },
1170
1171
  },
@@ -1174,11 +1175,11 @@ export const prepareVaultManagerKit = (
1174
1175
  helper.start();
1175
1176
  void state.assetTopicKit.recorder.write(
1176
1177
  harden({
1177
- compoundedStabilityFee: state.compoundedStabilityFee,
1178
- stabilityFee: factoryPowers
1178
+ compoundedInterest: state.compoundedInterest,
1179
+ interestRate: factoryPowers
1179
1180
  .getGovernedParams(state.collateralBrand)
1180
- .getStabilityFee(),
1181
- latestStabilityFeeUpdate: state.latestStabilityFeeUpdate,
1181
+ .getInterestRate(),
1182
+ latestInterestUpdate: state.latestInterestUpdate,
1182
1183
  }),
1183
1184
  );
1184
1185