Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ezequiel-num
Copy link

  • WIP:
  • Description: Collateral Plugins for NARS / SNARS Tokens

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

common/configuration.ts Outdated Show resolved Hide resolved
/**
* @title SnARSFiatCollateral
* @notice Collateral plugin for a Num vault with fiat collateral
* Expected: {tok} != {ref}, {ref} is pegged to {target} unless defaulting, {target} == {UoA}
Copy link
Collaborator

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed thanks!

Copy link
Collaborator

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'
Copy link
Collaborator

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)

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?

Copy link
Collaborator

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
Copy link
Collaborator

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

Copy link
Collaborator

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/constants.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%
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants