Skip to content

Commit

Permalink
rename stabilityFeeSnapshot to interestRateSnapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
iomekam committed Jul 20, 2023
1 parent 97fdac6 commit 2a447fc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/inter-protocol/src/vaultFactory/vault.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const validTransitions = {
* Snapshot is of the debt and compounded interest when the principal was last changed.
*
* @typedef {{
* stabilityFeeSnapshot: Ratio,
* interestRateSnapshot: Ratio,
* phase: VaultPhase,
* debtSnapshot: Amount<'nat'>,
* outerUpdater: import('@agoric/zoe/src/contractSupport/recorder.js').Recorder<VaultNotification> | null,
Expand Down Expand Up @@ -132,7 +132,7 @@ const VaultStateShape = harden({
phase: M.any(),
storageNode: M.any(),
vaultSeat: M.any(),
stabilityFeeSnapshot: M.any(),
interestRateSnapshot: M.any(),
debtSnapshot: M.any(),
});

Expand Down Expand Up @@ -174,7 +174,7 @@ export const prepareVault = (baggage, makeRecorderKit, zcf) => {
vaultSeat: zcf.makeEmptySeatKit().zcfSeat,

// Two values from the same moment
stabilityFeeSnapshot: manager.getCompoundedStabilityFee(),
interestRateSnapshot: manager.getCompoundedStabilityFee(),
debtSnapshot: AmountMath.makeEmpty(manager.getDebtBrand()),
});
},
Expand Down Expand Up @@ -257,7 +257,7 @@ export const prepareVault = (baggage, makeRecorderKit, zcf) => {

// update local state
state.debtSnapshot = newDebt;
state.stabilityFeeSnapshot =
state.interestRateSnapshot =
state.manager.getCompoundedStabilityFee();
},

Expand Down Expand Up @@ -328,7 +328,7 @@ export const prepareVault = (baggage, makeRecorderKit, zcf) => {
getStateSnapshot(newPhase) {
const { state, facets } = this;

const { debtSnapshot: debt, stabilityFeeSnapshot: stabilityFee } =
const { debtSnapshot: debt, interestRateSnapshot: stabilityFee } =
state;
/** @type {VaultNotification} */
return harden({
Expand Down Expand Up @@ -787,7 +787,7 @@ export const prepareVault = (baggage, makeRecorderKit, zcf) => {
helper.updateDebtSnapshot(self.getCurrentDebt());
const {
debtSnapshot: debt,
stabilityFeeSnapshot: stabilityFee,
interestRateSnapshot: stabilityFee,
phase,
} = state;
if (outerUpdater) {
Expand Down Expand Up @@ -841,7 +841,7 @@ export const prepareVault = (baggage, makeRecorderKit, zcf) => {
const { state } = this;
return calculateCurrentDebt(
state.debtSnapshot,
state.stabilityFeeSnapshot,
state.interestRateSnapshot,
state.manager.getCompoundedStabilityFee(),
);
},
Expand All @@ -861,7 +861,7 @@ export const prepareVault = (baggage, makeRecorderKit, zcf) => {
// @ts-expect-error cast
return reverseInterest(
state.debtSnapshot,
state.stabilityFeeSnapshot,
state.interestRateSnapshot,
);
},
},
Expand Down

0 comments on commit 2a447fc

Please sign in to comment.