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] virtual rate uses outdated p2p amount #1673

Open QGarchery opened 8 months ago

QGarchery commented 8 months ago

When the Lens computes the virtual rate that you would get from entering a position, the p2p amount is not updated. This leads to a rare case where there is an error on the rate. Here is a small recap on Aave-v2: