Skip to content

CR Oracle fix#332

Merged
Joeysantoro merged 16 commits intodevelopfrom
feat/fix-cr
Dec 4, 2021
Merged

CR Oracle fix#332
Joeysantoro merged 16 commits intodevelopfrom
feat/fix-cr

Conversation

@Joeysantoro
Copy link
Contributor

@Joeysantoro Joeysantoro commented Nov 24, 2021

Updates the CollateralizationOracle values to have the most up to date PCV numbers:
Add -

          '{feiLusdLens}',
          '{aaveFeiPCVDepositWrapper}',
          '{creamDepositWrapper}',
          '{balDepositWrapper}',
          '{rariPool7LusdPCVDeposit}',
          '{staticPcvDepositWrapper2}',
          '{feiBuybackLens}'

Remove the 2 duplicate Fuse deposits and old staticPcvDepositWrapper

Adds BPTLens to be able to calculate the resistant balances of the LBP tokens. Uses gas efficient calculations by deriving optimized versions of the ideal reserves formula

Replaces existing StaticPCVDepositWrapper with a new one that allows for incrementing and decrementing with new values:

  • balance = 2m (down from 4m for INDEX holdings)
  • resistantFei = 61.5m (up 50m from 11.5m to add Ondo)

xklob
xklob previously requested changes Nov 24, 2021
Copy link
Contributor

@xklob xklob left a comment

Choose a reason for hiding this comment

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

This is awesome, some comments.
I'd also like to see unit tests for BPTLens.sol (and also maybe go over it together over zoom?)


chai.use(CBN(ethers.BigNumber));

const CHAINLINK_LUSD = '0x3D7aE7E594f2f2091Ad8798313450130d0Aba3a0';
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not add these to mainnet addresses instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

these seemed transient. Because they are external I'd rather just keep them out. That file is getting unwieldy

// 2. Bal-Eth oracle
const chainlinkBALEthOracle = await chainlinkFactory.deploy(core, CHAINLINK_BAL);

await chainlinkBALEthOracle.deployed();
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe it's actually

await chainlinkBALETHOracle.deployTransaction.wait()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

eswak
eswak previously requested changes Nov 25, 2021
Copy link
Contributor

@eswak eswak left a comment

Choose a reason for hiding this comment

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

I think we should also add these :

  • Oracle price for stkAAVE token
  • ERC20 Lens for stkAAVE on the Aave ETH deposit
  • ERC20 Lens for stkAAVE on the Aave RAI deposit
  • Oracle price for COMP token
  • ERC20 Lens for COMP on the Compound ETH deposit
  • ERC20 Lens for COMP on the Compound DAI deposit
  • Oracle price for TOKE token
  • Add the TOKE Tokemak deposit

I'd also update the Angle proposal to add ANGLE price feed, and a lens on the deposit, but I don't think they have a good price feed yet ? I'll ask them on Telegram.

edit: correction, the Aave reward claims are not permissionless, we'll need to write a new contract for that. We have ~630 stkAAVE rewards to claim (~160k$) for the ETH deposit, but we can't claim them permissionlessly, we need to write a new "reward claimer" contract, ask the Aave team to authorize it as a claimer for our PCVDeposits, and then we'll be able to claim. We also have ~63 stkAAVE from the RAI deposit. Claim happens on 0xd784927Ff2f95ba542BfC824c8a8a98F3495f6b5. Maybe we wait for a more in-depth rework of the rewards claimer / moving architecture, before adding these...

@Joeysantoro
Copy link
Contributor Author

  • Oracle price for COMP token
  • ERC20 Lens for COMP on the Compound ETH deposit
  • ERC20 Lens for COMP on the Compound DAI deposit
  • Oracle price for TOKE token
  • Add the TOKE Tokemak deposit

I don't think its worth adding these until they make up a larger percentage of PCV and we have better infrastructure for deploying them

@Joeysantoro Joeysantoro requested a review from eswak November 25, 2021 21:44
@Joeysantoro Joeysantoro dismissed stale reviews from eswak and xklob November 25, 2021 21:45

stale

eswak
eswak previously approved these changes Nov 26, 2021
@eswak
Copy link
Contributor

eswak commented Nov 26, 2021

check e2e tests before merge & we are go for launch ?

Copy link
Contributor

@eswak eswak left a comment

Choose a reason for hiding this comment

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

Code lgtm, one last thing : the feiBuybackLens at 0x107460564896377BA6CdcC7516c7eAb65E32E360 is not verified

Also, can you break me down what the 61.5M FEI from the static PCV deposit are for ? And do you confirm the 2M$ are for the INDEX holdings ?

Eventually you can add 500k for FEI Idle AA tranche and 2M FEI Visor, or I'll queue an OA action for it after I'm done writing the full breakdown to make sure we still have not forgot something else

import dependencies from '@addresses/dependencies';

describe('e2e-dependencies', function () {
describe.skip('e2e-dependencies', function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

did you intend to commit this ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes

@Joeysantoro Joeysantoro merged commit 99a5c4f into develop Dec 4, 2021
@Joeysantoro Joeysantoro deleted the feat/fix-cr branch December 4, 2021 07:17
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.

3 participants

Comments