@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/inter-protocol",
3
- "version": "0.16.1-dev-13050c2.0+13050c2",
3
+ "version": "0.16.1-dev-69236fd.0+69236fd",
4
4
  "description": "Core cryptoeconomy contracts",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -30,29 +30,29 @@
30
30
  },
31
31
  "homepage": "https://github.com/Agoric/agoric-sdk#readme",
32
32
  "dependencies": {
33
- "@agoric/assert": "0.6.1-dev-13050c2.0+13050c2",
34
- "@agoric/ertp": "0.16.3-dev-13050c2.0+13050c2",
35
- "@agoric/governance": "0.10.3-dev-13050c2.0+13050c2",
36
- "@agoric/internal": "0.3.3-dev-13050c2.0+13050c2",
37
- "@agoric/notifier": "0.6.3-dev-13050c2.0+13050c2",
38
- "@agoric/store": "0.9.3-dev-13050c2.0+13050c2",
39
- "@agoric/time": "0.3.3-dev-13050c2.0+13050c2",
40
- "@agoric/vat-data": "0.5.3-dev-13050c2.0+13050c2",
41
- "@agoric/vats": "0.15.1-dev-13050c2.0+13050c2",
42
- "@agoric/zoe": "0.26.3-dev-13050c2.0+13050c2",
33
+ "@agoric/assert": "0.6.1-dev-69236fd.0+69236fd",
34
+ "@agoric/ertp": "0.16.3-dev-69236fd.0+69236fd",
35
+ "@agoric/governance": "0.10.3-dev-69236fd.0+69236fd",
36
+ "@agoric/internal": "0.3.3-dev-69236fd.0+69236fd",
37
+ "@agoric/notifier": "0.6.3-dev-69236fd.0+69236fd",
38
+ "@agoric/store": "0.9.3-dev-69236fd.0+69236fd",
39
+ "@agoric/time": "0.3.3-dev-69236fd.0+69236fd",
40
+ "@agoric/vat-data": "0.5.3-dev-69236fd.0+69236fd",
41
+ "@agoric/vats": "0.15.1-dev-69236fd.0+69236fd",
42
+ "@agoric/zoe": "0.26.3-dev-69236fd.0+69236fd",
43
43
  "@endo/captp": "^3.1.1",
44
44
  "@endo/eventual-send": "^0.17.2",
45
45
  "@endo/far": "^0.2.18",
46
46
  "@endo/marshal": "^0.8.5",
47
47
  "@endo/nat": "^4.1.27",
48
- "agoric": "0.21.1-dev-13050c2.0+13050c2",
48
+ "agoric": "0.21.1-dev-69236fd.0+69236fd",
49
49
  "jessie.js": "^0.3.2"
50
50
  },
51
51
  "devDependencies": {
52
- "@agoric/deploy-script-support": "0.10.3-dev-13050c2.0+13050c2",
53
- "@agoric/smart-wallet": "0.5.3-dev-13050c2.0+13050c2",
54
- "@agoric/swingset-liveslots": "0.10.3-dev-13050c2.0+13050c2",
55
- "@agoric/swingset-vat": "0.32.3-dev-13050c2.0+13050c2",
52
+ "@agoric/deploy-script-support": "0.10.3-dev-69236fd.0+69236fd",
53
+ "@agoric/smart-wallet": "0.5.3-dev-69236fd.0+69236fd",
54
+ "@agoric/swingset-liveslots": "0.10.3-dev-69236fd.0+69236fd",
55
+ "@agoric/swingset-vat": "0.32.3-dev-69236fd.0+69236fd",
56
56
  "@endo/bundle-source": "^2.5.1",
57
57
  "@endo/init": "^0.5.56",
58
58
  "@endo/promise-kit": "^0.2.56",
@@ -80,5 +80,5 @@
80
80
  "publishConfig": {
81
81
  "access": "public"
82
82
  },
83
- "gitHead": "13050c28e9a154e188cff8f1d08c704a4c7ca26a"
83
+ "gitHead": "69236fdbdce1521dd78da104bd54f331d4d2b28f"
84
84
  }
@@ -10,7 +10,7 @@ export const defaultProposalBuilder = async (
10
10
  { publishRef, install: install0, wrapInstall },
11
11
  {
12
12
  debtLimitValue = undefined,
13
- interestRateValue = undefined,
13
+ stabilityFeeValue = undefined,
14
14
  interchainAssetOptions = /** @type {object} */ ({}),
15
15
  } = {},
16
16
  { env = process.env } = {},
@@ -38,7 +38,7 @@ export const defaultProposalBuilder = async (
38
38
  getManifestForAddAssetToVault.name,
39
39
  {
40
40
  debtLimitValue: debtLimitValue && BigInt(debtLimitValue),
41
- interestRateValue: interestRateValue && BigInt(interestRateValue),
41
+ stabilityFeeValue: stabilityFeeValue && BigInt(stabilityFeeValue),
42
42
  interchainAssetOptions: {
43
43
  denom,
44
44
  issuerBoardId,
@@ -9,39 +9,39 @@ import {
9
9
  } from '@agoric/zoe/src/contractSupport/ratio.js';
10
10
 
11
11
  /**
12
- * @param {Ratio} currentCompoundedInterest as coefficient
13
- * @param {Ratio} previousCompoundedInterest as coefficient
12
+ * @param {Ratio} currentCompoundedStabilityFee as coefficient
13
+ * @param {Ratio} previousCompoundedStabilityFee as coefficient
14
14
  * @returns {Ratio} additional compounding since the previous
15
15
  */
16
16
  const calculateRelativeCompounding = (
17
- currentCompoundedInterest,
18
- previousCompoundedInterest,
17
+ currentCompoundedStabilityFee,
18
+ previousCompoundedStabilityFee,
19
19
  ) => {
20
20
  // divide compounded interest by the snapshot
21
21
  return multiplyRatios(
22
- currentCompoundedInterest,
23
- invertRatio(previousCompoundedInterest),
22
+ currentCompoundedStabilityFee,
23
+ invertRatio(previousCompoundedStabilityFee),
24
24
  );
25
25
  };
26
26
 
27
27
  /**
28
28
  * @param {Amount<'nat'>} debtSnapshot
29
- * @param {Ratio} interestSnapshot as coefficient
30
- * @param {Ratio} currentCompoundedInterest as coefficient
29
+ * @param {Ratio} stabilityFeeSnapshot as coefficient
30
+ * @param {Ratio} currentCompoundedStabilityFee as coefficient
31
31
  * @returns {Amount<'nat'>}
32
32
  */
33
33
  export const calculateCurrentDebt = (
34
34
  debtSnapshot,
35
- interestSnapshot,
36
- currentCompoundedInterest,
35
+ stabilityFeeSnapshot,
36
+ currentCompoundedStabilityFee,
37
37
  ) => {
38
- if (ratiosSame(interestSnapshot, currentCompoundedInterest)) {
38
+ if (ratiosSame(stabilityFeeSnapshot, currentCompoundedStabilityFee)) {
39
39
  return debtSnapshot;
40
40
  }
41
41
 
42
42
  const interestSinceSnapshot = calculateRelativeCompounding(
43
- currentCompoundedInterest,
44
- interestSnapshot,
43
+ currentCompoundedStabilityFee,
44
+ stabilityFeeSnapshot,
45
45
  );
46
46
 
47
47
  return multiplyBy(debtSnapshot, interestSinceSnapshot);
package/src/interest.js CHANGED
@@ -57,8 +57,8 @@ export const makeInterestCalculator = (
57
57
  * @type {Calculate}
58
58
  */
59
59
  const calculate = (debtStatus, currentTime) => {
60
- const { newDebt, latestInterestUpdate } = debtStatus;
61
- let newRecent = latestInterestUpdate;
60
+ const { newDebt, latestStabilityFeeUpdate } = debtStatus;
61
+ let newRecent = latestStabilityFeeUpdate;
62
62
  let growingInterest = debtStatus.interest;
63
63
  let growingDebt = newDebt;
64
64
  while (
@@ -78,7 +78,7 @@ export const makeInterestCalculator = (
78
78
  growingDebt += newInterest;
79
79
  }
80
80
  return {
81
- latestInterestUpdate: newRecent,
81
+ latestStabilityFeeUpdate: newRecent,
82
82
  interest: growingInterest,
83
83
  newDebt: growingDebt,
84
84
  };
@@ -93,9 +93,9 @@ export const makeInterestCalculator = (
93
93
  * @type {Calculate}
94
94
  */
95
95
  const calculateReportingPeriod = (debtStatus, currentTime) => {
96
- const { latestInterestUpdate } = debtStatus;
96
+ const { latestStabilityFeeUpdate } = debtStatus;
97
97
  const overshoot = TimeMath.modRelRel(
98
- TimeMath.subtractAbsAbs(currentTime, latestInterestUpdate),
98
+ TimeMath.subtractAbsAbs(currentTime, latestStabilityFeeUpdate),
99
99
  recordingPeriod,
100
100
  );
101
101
  return calculate(
@@ -111,20 +111,20 @@ export const makeInterestCalculator = (
111
111
  };
112
112
 
113
113
  /**
114
- * compoundedInterest *= (new debt) / (prior total debt)
114
+ * compoundedStabilityFee *= (new debt) / (prior total debt)
115
115
  *
116
- * @param {Ratio} priorCompoundedInterest
116
+ * @param {Ratio} priorCompoundedStabilityFee
117
117
  * @param {NatValue} priorDebt
118
118
  * @param {NatValue} newDebt
119
119
  */
120
- export const calculateCompoundedInterest = (
121
- priorCompoundedInterest,
120
+ export const calculateCompoundedStabilityFee = (
121
+ priorCompoundedStabilityFee,
122
122
  priorDebt,
123
123
  newDebt,
124
124
  ) => {
125
- const brand = priorCompoundedInterest.numerator.brand;
125
+ const brand = priorCompoundedStabilityFee.numerator.brand;
126
126
  const compounded = multiplyRatios(
127
- priorCompoundedInterest,
127
+ priorCompoundedStabilityFee,
128
128
  makeRatio(newDebt, brand, priorDebt, brand),
129
129
  );
130
130
  return quantize(compounded, COMPOUNDED_INTEREST_DENOMINATOR);
@@ -144,7 +144,7 @@ const validatedBrand = (mint, debt) => {
144
144
  };
145
145
 
146
146
  /**
147
- * Charge interest accrued between `latestInterestUpdate` and `accruedUntil`.
147
+ * Charge interest accrued between `latestStabilityFeeUpdate` and `accruedUntil`.
148
148
  *
149
149
  * @param {{
150
150
  * mint: ZCFMint<'nat'>,
@@ -152,21 +152,21 @@ const validatedBrand = (mint, debt) => {
152
152
  * poolIncrementSeat: ZCFSeat,
153
153
  * seatAllocationKeyword: Keyword }} powers
154
154
  * @param {{
155
- * interestRate: Ratio,
155
+ * stabilityFee: Ratio,
156
156
  * chargingPeriod: RelativeTime,
157
157
  * recordingPeriod: RelativeTime}} params
158
158
  * @param {{
159
- * latestInterestUpdate: Timestamp,
160
- * compoundedInterest: Ratio,
159
+ * latestStabilityFeeUpdate: Timestamp,
160
+ * compoundedStabilityFee: Ratio,
161
161
  * totalDebt: Amount<'nat'>}} prior
162
162
  * @param {Timestamp} accruedUntil
163
- * @returns {{compoundedInterest: Ratio, latestInterestUpdate: Timestamp, totalDebt: Amount<'nat'> }}
163
+ * @returns {{compoundedStabilityFee: Ratio, latestStabilityFeeUpdate: Timestamp, totalDebt: Amount<'nat'> }}
164
164
  */
165
165
  export const chargeInterest = (powers, params, prior, accruedUntil) => {
166
166
  const brand = validatedBrand(powers.mint, prior.totalDebt);
167
167
 
168
168
  const interestCalculator = makeInterestCalculator(
169
- params.interestRate,
169
+ params.stabilityFee,
170
170
  params.chargingPeriod,
171
171
  params.recordingPeriod,
172
172
  );
@@ -174,7 +174,7 @@ export const chargeInterest = (powers, params, prior, accruedUntil) => {
174
174
  // calculate delta of accrued debt
175
175
  const debtStatus = interestCalculator.calculateReportingPeriod(
176
176
  {
177
- latestInterestUpdate: prior.latestInterestUpdate,
177
+ latestStabilityFeeUpdate: prior.latestStabilityFeeUpdate,
178
178
  newDebt: prior.totalDebt.value,
179
179
  interest: 0n, // XXX this is always zero, doesn't need to be an option
180
180
  },
@@ -185,8 +185,8 @@ export const chargeInterest = (powers, params, prior, accruedUntil) => {
185
185
  // done if none
186
186
  if (interestAccrued === 0n) {
187
187
  return {
188
- compoundedInterest: prior.compoundedInterest,
189
- latestInterestUpdate: debtStatus.latestInterestUpdate,
188
+ compoundedStabilityFee: prior.compoundedStabilityFee,
189
+ latestStabilityFeeUpdate: debtStatus.latestStabilityFeeUpdate,
190
190
  totalDebt: prior.totalDebt,
191
191
  };
192
192
  }
@@ -196,8 +196,8 @@ export const chargeInterest = (powers, params, prior, accruedUntil) => {
196
196
  // testing with small numbers there's 5 digits of precision, and with large
197
197
  // numbers the ratios tend towards ample precision.
198
198
  // TODO adopt banker's rounding https://github.com/Agoric/agoric-sdk/issues/4573
199
- const compoundedInterest = calculateCompoundedInterest(
200
- prior.compoundedInterest,
199
+ const compoundedStabilityFee = calculateCompoundedStabilityFee(
200
+ prior.compoundedStabilityFee,
201
201
  prior.totalDebt.value,
202
202
  debtStatus.newDebt,
203
203
  );
@@ -218,8 +218,8 @@ export const chargeInterest = (powers, params, prior, accruedUntil) => {
218
218
  );
219
219
 
220
220
  return {
221
- compoundedInterest,
222
- latestInterestUpdate: debtStatus.latestInterestUpdate,
221
+ compoundedStabilityFee,
222
+ latestStabilityFeeUpdate: debtStatus.latestStabilityFeeUpdate,
223
223
  totalDebt,
224
224
  };
225
225
  };
@@ -212,7 +212,7 @@ export const registerScaledPriceAuthority = async (
212
212
  * @param {object} config.options
213
213
  * @param {InterchainAssetOptions} config.options.interchainAssetOptions
214
214
  * @param {bigint | number | string} config.options.debtLimitValue
215
- * @param {bigint} config.options.interestRateValue
215
+ * @param {bigint} config.options.stabilityFeeValue
216
216
  */
217
217
  export const addAssetToVault = async (
218
218
  {
@@ -228,7 +228,7 @@ export const addAssetToVault = async (
228
228
  debtLimitValue = 1_000n * 1_000_000n,
229
229
  // Default to a safe value. Production will likely set this through governance.
230
230
  // Allow setting through bootstrap to simplify testing.
231
- interestRateValue = 1n,
231
+ stabilityFeeValue = 1n,
232
232
  interchainAssetOptions,
233
233
  },
234
234
  },
@@ -250,7 +250,7 @@ export const addAssetToVault = async (
250
250
  const vaultFactoryCreator = E.get(vaultFactoryKit).creatorFacet;
251
251
  await E(vaultFactoryCreator).addVaultType(interchainIssuer, oracleBrand, {
252
252
  debtLimit: AmountMath.make(stable, BigInt(debtLimitValue)),
253
- interestRate: makeRatio(interestRateValue, stable),
253
+ stabilityFee: makeRatio(stabilityFeeValue, stable),
254
254
  // The rest of these we use safe defaults.
255
255
  // In production they will be governed by the Econ Committee.
256
256
  // Product deployments are also expected to have a low debtLimitValue at the outset,
@@ -268,7 +268,7 @@ export const getManifestForAddAssetToVault = (
268
268
  { restoreRef },
269
269
  {
270
270
  debtLimitValue,
271
- interestRateValue,
271
+ stabilityFeeValue,
272
272
  interchainAssetOptions,
273
273
  scaledPriceAuthorityRef,
274
274
  },
@@ -341,7 +341,7 @@ export const getManifestForAddAssetToVault = (
341
341
  options: {
342
342
  debtLimitValue,
343
343
  interchainAssetOptions,
344
- interestRateValue,
344
+ stabilityFeeValue,
345
345
  },
346
346
  };
347
347
  };
@@ -21,7 +21,7 @@ export const DEBT_LIMIT_KEY = 'DebtLimit';
21
21
  export const LIQUIDATION_MARGIN_KEY = 'LiquidationMargin';
22
22
  export const LIQUIDATION_PADDING_KEY = 'LiquidationPadding';
23
23
  export const LIQUIDATION_PENALTY_KEY = 'LiquidationPenalty';
24
- export const INTEREST_RATE_KEY = 'InterestRate';
24
+ export const STABILITY_FEE_KEY = 'StabilityFee';
25
25
  export const MINT_FEE_KEY = 'MintFee';
26
26
  export const MIN_INITIAL_DEBT_KEY = 'MinInitialDebt';
27
27
  export const SHORTFALL_INVITATION_KEY = 'ShortfallInvitation';
@@ -89,7 +89,7 @@ export const makeVaultParamManager = (
89
89
  publisherKit,
90
90
  {
91
91
  debtLimit,
92
- interestRate,
92
+ stabilityFee,
93
93
  liquidationMargin,
94
94
  liquidationPadding = zeroRatio(liquidationMargin),
95
95
  liquidationPenalty,
@@ -98,7 +98,7 @@ export const makeVaultParamManager = (
98
98
  ) =>
99
99
  makeParamManagerSync(publisherKit, {
100
100
  [DEBT_LIMIT_KEY]: [ParamTypes.AMOUNT, debtLimit],
101
- [INTEREST_RATE_KEY]: [ParamTypes.RATIO, interestRate],
101
+ [STABILITY_FEE_KEY]: [ParamTypes.RATIO, stabilityFee],
102
102
  [LIQUIDATION_PADDING_KEY]: [ParamTypes.RATIO, liquidationPadding],
103
103
  [LIQUIDATION_MARGIN_KEY]: [ParamTypes.RATIO, liquidationMargin],
104
104
  [LIQUIDATION_PENALTY_KEY]: [ParamTypes.RATIO, liquidationPenalty],
@@ -110,7 +110,7 @@ export const vaultParamPattern = M.splitRecord(
110
110
  {
111
111
  liquidationMargin: ratioPattern,
112
112
  liquidationPenalty: ratioPattern,
113
- interestRate: ratioPattern,
113
+ stabilityFee: ratioPattern,
114
114
  mintFee: ratioPattern,
115
115
  debtLimit: amountPattern,
116
116
  },
@@ -131,15 +131,15 @@ harden(fromVaultKey);
131
131
  * For use by `normalizedCollRatioKey` and tests.
132
132
  *
133
133
  * @param {PriceQuote} quote
134
- * @param {Ratio} compoundedInterest
134
+ * @param {Ratio} compoundedStabilityFee
135
135
  * @param {Ratio} margin
136
136
  * @returns {number}
137
137
  */
138
- export const normalizedCollRatio = (quote, compoundedInterest, margin) => {
138
+ export const normalizedCollRatio = (quote, compoundedStabilityFee, margin) => {
139
139
  const amountIn = getAmountIn(quote).value;
140
140
  const amountOut = getAmountOut(quote).value;
141
- const interestNumerator = compoundedInterest.numerator.value;
142
- const interestBase = compoundedInterest.denominator.value;
141
+ const interestNumerator = compoundedStabilityFee.numerator.value;
142
+ const interestBase = compoundedStabilityFee.denominator.value;
143
143
  const numerator = multiply(
144
144
  margin.numerator.value,
145
145
  multiply(amountIn, interestNumerator),
@@ -159,13 +159,17 @@ harden(normalizedCollRatio);
159
159
  * out the numerator and the denominator, and divide only once.
160
160
  *
161
161
  * @param {PriceQuote} quote
162
- * @param {Ratio} compoundedInterest
162
+ * @param {Ratio} compoundedStabilityFee
163
163
  * @param {Ratio} margin
164
164
  * @returns {string} lexically sortable string in which highest
165
165
  * debt-to-collateral is earliest
166
166
  */
167
- export const normalizedCollRatioKey = (quote, compoundedInterest, margin) => {
168
- const collRatio = normalizedCollRatio(quote, compoundedInterest, margin);
167
+ export const normalizedCollRatioKey = (
168
+ quote,
169
+ compoundedStabilityFee,
170
+ margin,
171
+ ) => {
172
+ const collRatio = normalizedCollRatio(quote, compoundedStabilityFee, margin);
169
173
  return `${encodeNumber(collRatio)}:`;
170
174
  };
171
175
  harden(normalizedCollRatioKey);
@@ -26,7 +26,7 @@
26
26
  * @property {Ratio} liquidationMargin - margin below which collateral will be
27
27
  * liquidated to satisfy the debt.
28
28
  * @property {Ratio} liquidationPenalty - penalty charged upon liquidation as proportion of debt
29
- * @property {Ratio} interestRate - annual interest rate charged on debt positions
29
+ * @property {Ratio} stabilityFee - annual interest rate charged on debt positions
30
30
  * @property {Ratio} mintFee - The fee (in BasisPoints) charged when creating
31
31
  * or increasing a debt position.
32
32
  * @property {Amount<'nat'>} debtLimit
@@ -78,7 +78,7 @@
78
78
  * @property {() => Ratio} getLiquidationMargin
79
79
  * @property {() => Ratio} getMintFee
80
80
  * @property {() => Promise<PriceQuote>} getCollateralQuote
81
- * @property {() => Ratio} getInterestRate - The annual interest rate on a debt position
81
+ * @property {() => Ratio} getStabilityFee - The annual interest rate on a debt position
82
82
  * @property {() => RelativeTime} getChargingPeriod - The period (in seconds) at
83
83
  * which interest is charged to the debt position.
84
84
  * @property {() => RelativeTime} getRecordingPeriod - The period (in seconds)
@@ -109,8 +109,8 @@
109
109
 
110
110
  /**
111
111
  * @typedef {object} DebtStatus
112
- * @property {Timestamp} latestInterestUpdate
113
- * @property {NatValue} interest interest accrued since latestInterestUpdate
112
+ * @property {Timestamp} latestStabilityFeeUpdate
113
+ * @property {NatValue} interest interest accrued since latestStabilityFeeUpdate
114
114
  * @property {NatValue} newDebt total including principal and interest
115
115
  */
116
116
 
@@ -72,7 +72,7 @@ const validTransitions = {
72
72
  *
73
73
  * @typedef {object} VaultNotification
74
74
  * @property {Amount<'nat'>} locked Amount of Collateral locked
75
- * @property {{debt: Amount<'nat'>, interest: Ratio}} debtSnapshot 'debt' at the point the compounded interest was 'interest'
75
+ * @property {{debt: Amount<'nat'>, stabilityFee: Ratio}} debtSnapshot 'debt' at the point the compounded stabilityFee was 'stabilityFee'
76
76
  * @property {HolderPhase} vaultState
77
77
  */
78
78
 
@@ -86,7 +86,7 @@ const validTransitions = {
86
86
  * @property {() => Brand<'nat'>} getDebtBrand
87
87
  * @property {MintAndTransfer} mintAndTransfer
88
88
  * @property {(amount: Amount, seat: ZCFSeat) => void} burn
89
- * @property {() => Ratio} getCompoundedInterest
89
+ * @property {() => Ratio} getCompoundedStabilityFee
90
90
  * @property {(oldDebt: import('./storeUtils.js').NormalizedDebt, oldCollateral: Amount<'nat'>, vaultId: VaultId, vaultPhase: VaultPhase, vault: Vault) => void} handleBalanceChange
91
91
  * @property {() => import('./vaultManager.js').GovernedParamGetters} getGovernedParams
92
92
  */
@@ -104,7 +104,7 @@ const validTransitions = {
104
104
  * Snapshot is of the debt and compounded interest when the principal was last changed.
105
105
  *
106
106
  * @typedef {{
107
- * interestSnapshot: Ratio,
107
+ * stabilityFeeSnapshot: Ratio,
108
108
  * phase: VaultPhase,
109
109
  * debtSnapshot: Amount<'nat'>,
110
110
  * outerUpdater: import('@agoric/zoe/src/contractSupport/recorder.js').Recorder<VaultNotification> | null,
@@ -132,7 +132,7 @@ const VaultStateShape = harden({
132
132
  phase: M.any(),
133
133
  storageNode: M.any(),
134
134
  vaultSeat: M.any(),
135
- interestSnapshot: M.any(),
135
+ stabilityFeeSnapshot: M.any(),
136
136
  debtSnapshot: M.any(),
137
137
  });
138
138
 
@@ -174,7 +174,7 @@ export const prepareVault = (baggage, makeRecorderKit, zcf) => {
174
174
  vaultSeat: zcf.makeEmptySeatKit().zcfSeat,
175
175
 
176
176
  // Two values from the same moment
177
- interestSnapshot: manager.getCompoundedInterest(),
177
+ stabilityFeeSnapshot: manager.getCompoundedStabilityFee(),
178
178
  debtSnapshot: AmountMath.makeEmpty(manager.getDebtBrand()),
179
179
  });
180
180
  },
@@ -257,7 +257,8 @@ export const prepareVault = (baggage, makeRecorderKit, zcf) => {
257
257
 
258
258
  // update local state
259
259
  state.debtSnapshot = newDebt;
260
- state.interestSnapshot = state.manager.getCompoundedInterest();
260
+ state.stabilityFeeSnapshot =
261
+ state.manager.getCompoundedStabilityFee();
261
262
  },
262
263
 
263
264
  /**
@@ -327,10 +328,11 @@ export const prepareVault = (baggage, makeRecorderKit, zcf) => {
327
328
  getStateSnapshot(newPhase) {
328
329
  const { state, facets } = this;
329
330
 
330
- const { debtSnapshot: debt, interestSnapshot: interest } = state;
331
+ const { debtSnapshot: debt, stabilityFeeSnapshot: stabilityFee } =
332
+ state;
331
333
  /** @type {VaultNotification} */
332
334
  return harden({
333
- debtSnapshot: { debt, interest },
335
+ debtSnapshot: { debt, stabilityFee },
334
336
  locked: facets.self.getCollateralAmount(),
335
337
  // newPhase param is so that makeTransferInvitation can finish without setting the vault's phase
336
338
  // TODO refactor https://github.com/Agoric/agoric-sdk/issues/4415
@@ -785,7 +787,7 @@ export const prepareVault = (baggage, makeRecorderKit, zcf) => {
785
787
  helper.updateDebtSnapshot(self.getCurrentDebt());
786
788
  const {
787
789
  debtSnapshot: debt,
788
- interestSnapshot: interest,
790
+ stabilityFeeSnapshot: stabilityFee,
789
791
  phase,
790
792
  } = state;
791
793
  if (outerUpdater) {
@@ -795,7 +797,7 @@ export const prepareVault = (baggage, makeRecorderKit, zcf) => {
795
797
  state.outerUpdater = null;
796
798
  }
797
799
  const transferState = {
798
- debtSnapshot: { debt, interest },
800
+ debtSnapshot: { debt, stabilityFee },
799
801
  locked: self.getCollateralAmount(),
800
802
  vaultState: phase,
801
803
  };
@@ -839,8 +841,8 @@ export const prepareVault = (baggage, makeRecorderKit, zcf) => {
839
841
  const { state } = this;
840
842
  return calculateCurrentDebt(
841
843
  state.debtSnapshot,
842
- state.interestSnapshot,
843
- state.manager.getCompoundedInterest(),
844
+ state.stabilityFeeSnapshot,
845
+ state.manager.getCompoundedStabilityFee(),
844
846
  );
845
847
  },
846
848
 
@@ -857,7 +859,10 @@ export const prepareVault = (baggage, makeRecorderKit, zcf) => {
857
859
  getNormalizedDebt() {
858
860
  const { state } = this;
859
861
  // @ts-expect-error cast
860
- return reverseInterest(state.debtSnapshot, state.interestSnapshot);
862
+ return reverseInterest(
863
+ state.debtSnapshot,
864
+ state.stabilityFeeSnapshot,
865
+ );
861
866
  },
862
867
  },
863
868
  },