-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: integrate with changes to paramManager
extracted params to a separate file
- Loading branch information
1 parent
30bfdb8
commit 41f66c5
Showing
11 changed files
with
152 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,7 +70,7 @@ | |
}, | ||
"eslintConfig": { | ||
"extends": [ | ||
"@endo" | ||
"@agoric" | ||
] | ||
}, | ||
"eslintIgnore": [ | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
// @ts-check | ||
|
||
import { buildParamManager, ParamType } from '@agoric/governance'; | ||
|
||
export const POOL_FEE_KEY = 'PoolFee'; | ||
export const PROTOCOL_FEE_KEY = 'ProtocolFee'; | ||
|
||
export const CHARGING_PERIOD_KEY = 'ChargingPeriod'; | ||
export const RECORDING_PERIOD_KEY = 'RecordingPeriod'; | ||
|
||
export const INITIAL_MARGIN_KEY = 'InitialMargin'; | ||
export const LIQUIDATION_MARGIN_KEY = 'LiquidationMargin'; | ||
export const INTEREST_RATE_KEY = 'InterestRate'; | ||
export const LOAN_FEE_KEY = 'LoanFee'; | ||
|
||
export const governedParameterTerms = () => ({ | ||
loanParams: { | ||
POOL_FEE_KEY, | ||
PROTOCOL_FEE_KEY, | ||
}, | ||
poolParams: { | ||
CHARGING_PERIOD_KEY, | ||
RECORDING_PERIOD_KEY, | ||
INITIAL_MARGIN_KEY, | ||
LIQUIDATION_MARGIN_KEY, | ||
INTEREST_RATE_KEY, | ||
LOAN_FEE_KEY, | ||
}, | ||
}); | ||
|
||
export const makeFeeGovernor = loanParams => { | ||
/** @type {FeeGovernor} */ | ||
return buildParamManager([ | ||
{ | ||
name: POOL_FEE_KEY, | ||
value: loanParams.poolFee, | ||
type: ParamType.NAT, | ||
}, | ||
{ | ||
name: PROTOCOL_FEE_KEY, | ||
value: loanParams.protocolFee, | ||
type: ParamType.NAT, | ||
}, | ||
]); | ||
}; | ||
|
||
export const makePoolGovernor = (loanParams, rates) => { | ||
/** @type {PoolGovernor} */ | ||
return buildParamManager([ | ||
{ | ||
name: CHARGING_PERIOD_KEY, | ||
value: loanParams.chargingPeriod, | ||
type: ParamType.NAT, | ||
}, | ||
{ | ||
name: RECORDING_PERIOD_KEY, | ||
value: loanParams.recordingPeriod, | ||
type: ParamType.NAT, | ||
}, | ||
{ | ||
name: INITIAL_MARGIN_KEY, | ||
value: rates.initialMargin, | ||
type: ParamType.RATIO, | ||
}, | ||
{ | ||
name: LIQUIDATION_MARGIN_KEY, | ||
value: rates.liquidationMargin, | ||
type: ParamType.RATIO, | ||
}, | ||
{ | ||
name: INTEREST_RATE_KEY, | ||
value: rates.interestRate, | ||
type: ParamType.RATIO, | ||
}, | ||
{ | ||
name: LOAN_FEE_KEY, | ||
value: rates.loanFee, | ||
type: ParamType.RATIO, | ||
}, | ||
]); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.