compound-finance / palisade

Compound Web3 Front-end
https://v2-app.compound.finance
GNU General Public License v3.0
111 stars 83 forks source link

Incorrect cWBTC borrow and supply curves on frontend #69

Open engn33r opened 1 year ago

engn33r commented 1 year ago

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

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.