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

Incorrect cWBTC borrow and supply curves on frontend #69

Open
engn33r opened this issue May 20, 2023 · 0 comments
Open

Incorrect cWBTC borrow and supply curves on frontend #69

engn33r opened this issue May 20, 2023 · 0 comments

Comments

@engn33r
Copy link

engn33r commented May 20, 2023

The cWBTC borrow and supply curve is incorrect on the Compound v2 UI at https://app.compound.finance/markets/?market=v2

Example: Consider the cWBTC market at 80% utilization. Sample values for this point are

  • cash: 20000000000000
  • borrows: 80000000000000
  • reserves: 0
  • reserveMantissa: 200000000000000000

Entering these values into getBorrowRate and getSupplyRate in etherscan, the resulting values are 95129375951 and 60882800608 respectively. After multiplying this rate-per-block by the blocks-per-year value of 2628000, we find the borrow rate is 25% and the supply rate is 16%. But when hovering over the 80% utilization in the UI, the UI suggests a borrow rate of 24.5% and a supply rate of 18.13%. Therefore, the UI curves do not match the on-chain cWBTC deployment.

Another point of concern is that the slope of the borrow rate and supply rate in the UI is not linear. The borrow and supply rates have less than a 3% difference at 0% utilization, then have a difference of over 8% at 40% utilization, and return to less than a 6% difference at the 80% utilization point. This implies that the curves diverge and later converge, and therefore are not linear. The on-chain interest rate curves are linear.

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

No branches or pull requests

1 participant