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

OA tx : Balancer pfei accounting fix + remove PCVDeposits with bad debts #776

Merged
merged 15 commits into from
May 13, 2022

Conversation

eswak
Copy link
Contributor

@eswak eswak commented May 5, 2022

OA Action to fix CR accounting

image

Accounted PCV loss :

  • 5M DAI (Pool 8)
  • 5M LUSD (Pool 8)
  • 2500 ETH ~= 7M$ (Pool 146)

Accounted protocol FEI becoming circulating :

  • 20.8M (Pool 8)
  • 800k (Pool 18)
  • 1053k (Pool 27)
  • 334k (Pool 90)
  • 10.2M (Pool 156)
  • ~10M (Balancer lens fix)

About the Balancer lens fix :
It used to report all the FEI in the B-70WETH-30FEI pool as protocol-owned (28M) and not only the FEI that is within the LP tokens held by the protocol. The protocol owns ~70% of the pool, so it used to count 28M porotocol FEI (the whole pool) instead of 19M (70% of total).

New lens address : https://etherscan.io/address/0x673f7dfa863b611de657759aede629b260f4e682

Calldata: 0x8f2a0bb000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000005c50ea05d516b0f626e2c103006033b9e3d4cffb58238bf4ef4e6abd6004534b00000000000000000000000000000000000000000000000000000000000546000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000ff6f59333cfd8f4ebc14ad0a0e181a83e655d257000000000000000000000000ff6f59333cfd8f4ebc14ad0a0e181a83e655d2570000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000044562f80fa000000000000000000000000b31f75550e97a2c4c7ac8d4355032b8ae8b9584d000000000000000000000000673f7dfa863b611de657759aede629b260f4e682000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000144e0baee2e00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000008000000000000000000000000d6598a23418c7fef7c0dc863265515b623b720f90000000000000000000000009cc46ab5a714f7cd24c59f33c5769039b5872491000000000000000000000000f846ee6e8ee9a6fbf51c7c65105cabc041c048ad00000000000000000000000007f2dd7e6a78d96c08d0a8212f4097dcc129d629000000000000000000000000e2e35097638f0ff2eeca2ef70f352be37431945f000000000000000000000000ec54148cbc47bff8fcc5e04e5e8083adb8af9ad9000000000000000000000000c68412b72e68c30d4e6c0854b439cbbe957146e40000000000000000000000001370ca8655c255948d6c6110066d78680601b7c200000000000000000000000000000000000000000000000000000000

Execute Calldata: 0xe38335e500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000005c50ea05d516b0f626e2c103006033b9e3d4cffb58238bf4ef4e6abd6004534b0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000ff6f59333cfd8f4ebc14ad0a0e181a83e655d257000000000000000000000000ff6f59333cfd8f4ebc14ad0a0e181a83e655d2570000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000044562f80fa000000000000000000000000b31f75550e97a2c4c7ac8d4355032b8ae8b9584d000000000000000000000000673f7dfa863b611de657759aede629b260f4e682000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000144e0baee2e00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000008000000000000000000000000d6598a23418c7fef7c0dc863265515b623b720f90000000000000000000000009cc46ab5a714f7cd24c59f33c5769039b5872491000000000000000000000000f846ee6e8ee9a6fbf51c7c65105cabc041c048ad00000000000000000000000007f2dd7e6a78d96c08d0a8212f4097dcc129d629000000000000000000000000e2e35097638f0ff2eeca2ef70f352be37431945f000000000000000000000000ec54148cbc47bff8fcc5e04e5e8083adb8af9ad9000000000000000000000000c68412b72e68c30d4e6c0854b439cbbe957146e40000000000000000000000001370ca8655c255948d6c6110066d78680601b7c200000000000000000000000000000000000000000000000000000000

@eswak eswak marked this pull request as ready for review May 6, 2022 16:01
@eswak eswak requested a review from a team as a code owner May 6, 2022 16:01
@thomas-waite thomas-waite self-requested a review May 9, 2022 10:13
Copy link
Contributor

@thomas-waite thomas-waite left a comment

Choose a reason for hiding this comment

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

Looks good to me. I'd probably add a unit test to validate the fix, but overall looks great

protocol-configuration/dependencies.ts Show resolved Hide resolved
proposals/dao/oa_cr_fix.ts Show resolved Hide resolved
contracts/pcv/balancer/BalancerPool2Lens.sol Show resolved Hide resolved
proposals/dao/oa_cr_fix.ts Outdated Show resolved Hide resolved
@thomas-waite thomas-waite self-requested a review May 9, 2022 15:37
thomas-waite
thomas-waite previously approved these changes May 9, 2022
Copy link
Contributor

@thomas-waite thomas-waite left a comment

Choose a reason for hiding this comment

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

LGTM

target: 'collateralizationOracle',
values: '0',
method: 'swapDeposit(address,address)',
arguments: ['{balancerLensBpt30Fei70Weth}', '{balancerLensBpt30Fei70WethFixed}'],
Copy link
Contributor

Choose a reason for hiding this comment

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

now is a good time to rethink our naming conventions. The arbitrary suffix "fixed" is not a super scalable convention.

If it has the same ABI I'd prefer making the fixed one called balancerLensBpt30Fei70Weth and naming the old one "old" or
"v1" or something

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah would prefer version numbers over "fixed"

Reminds me of how I used to name files in folders for school assignments. "Assignment1Fixed", "Assignment1FixedFinal", "Assignment1FixedFinalFinalSubmitThis.doc"

Copy link
Contributor Author

@eswak eswak May 10, 2022

Choose a reason for hiding this comment

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

renamed the old one to balancerLensBpt30Fei70WethOld and use the balancerLensBpt30Fei70Weth name for the new one.

@eswak
Copy link
Contributor Author

eswak commented May 10, 2022

Updated the PR description / screenshot / calldata, I think we're good to ship

@Joeysantoro Joeysantoro merged commit 83fd6fc into develop May 13, 2022
@Joeysantoro Joeysantoro deleted the fix/balancer-lens-pfei branch May 13, 2022 17:56
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