morpho-org / morpho-optimizers

Core contracts of Morpho V1 Optimizers.
https://app.morpho.org
GNU Affero General Public License v3.0
137 stars 22 forks source link

[Lens] p2p rate reverts when utilization > 100% on Compound #1674

Open QGarchery opened 6 months ago

QGarchery commented 6 months ago

In Compound it is actually possible to borrow the reserves, in which case utilization > 100%. The computation of the p2p rate of the Compound Lens reverts if utilization > 100%. This is because the supply rate is computed as multiplying the borrow rate by the utilization, so the pool supply rate is greater than the borrow rate.

A few things to note: