-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nars - snars - collateral plugin #1217
base: master
Are you sure you want to change the base?
nars - snars - collateral plugin #1217
Conversation
/** | ||
* @title SnARSFiatCollateral | ||
* @notice Collateral plugin for a Num vault with fiat collateral | ||
* Expected: {tok} != {ref}, {ref} is pegged to {target} unless defaulting, {target} == {UoA} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment is wrong. {target} == ARS, {UoA} == USD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
middle part still doesn't make sense. {ref} == {target}
/******** Deploy NARS Collateral - ARS **************************/ | ||
|
||
const NARSFiatCollateralFactory: ContractFactory = await hre.ethers.getContractFactory( | ||
'NARSCollateral' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NARSCollateral
does not exist. if you want to deploy nARS as a collateral (to be used as emergency collateral), you should deploy it as a fiat collateral (see scripts/deployment/phase2-assets/2_deploy_collaterals.ts
for examples)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right! I've fixed the issue by removing the script and integrating the fiat collateral deployment code into 2_deploy_collaterals.ts. Does this approach look good?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no i think you should still use this script (mostly because it is easier to run it as a one-off). just use the deploy-finat-collateral
task instead
@@ -1003,6 +1004,32 @@ export default function fn<X extends CollateralFixtureContext>( | |||
targetUnitOracle.address, | |||
ORACLE_TIMEOUT | |||
) | |||
} else if (target == ethers.utils.formatBytes32String('ARS')) { | |||
// ARS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we want to throw an error if not targetting Base, right? seems to be the only chain on which nARS is deployed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why was this removed? my point was that we just need to check if we're running the tests against base
test/plugins/individual-collateral/num/SNARSFiatCollateral.test.ts
Outdated
Show resolved
Hide resolved
maxTradeVolume: fp('1e6').toString(), // $1m, | ||
oracleTimeout: '900', | ||
targetName: hre.ethers.utils.formatBytes32String('ARS'), | ||
defaultThreshold: fp('0.01').toString(), // 1.5% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
configured as 1% but comment is 1.5%. i think 1.5% is correct?
Tokens Description:
NARS: Token peged to ARS (Argentinean Peso)
Token Address: 0x5e40f26E89213660514c51Fb61b2d357DBf63C85 (Base)
Valuation: Chianlink Oracle 0xC3a426Ef79fd60A4cA785FC04a2C3cB09d2FEeae
SNARS: Yield Bearing Token nomitaned in NARS
Token Address: 0xC1F4C75e8925A67BE4F35D6b1c044B5ea8849a58 (Base)
Valuation: (amount * convertToAsset(Function in the SNARS token Address)) / NARS Oracle Price