morpho-org / morpho-blue-irm

Morpho Blue Interest Rate Models
https://morpho.org
MIT License
26 stars 17 forks source link

fixed rate irm #123

Closed MathisGD closed 7 months ago

MathisGD commented 9 months ago

Fixed rate IRM for Morpho Blue. Anybody can set the rate for a market but it can be set only once. Typical use case is that the market creator batches the creation of the market with the fixed rate IRM with the setting of the rate they want for it on the IRM.

Note that this IRM probably doesn't make sense alone, as a lending pool with fixed IRM faces illiquidity risks. It will be used to experiment with different stuff like terms on blue.

This IRM makes market creators vulnerable to a griefing attack: for an oracle, you can set the rate for all the markets that make sense with this oracle, making these markets that could have been created in the future ususable. Meaning that now to create a market with the same pair of assets (with a different LLTV for example) you might have to re-deploy the oracle because a malicious actor could have set the rate already.

MathisGD commented 7 months ago

Tests are failing :/

not anymore :-) (weird rounding in adaptive curve irm when fuzzing that i can't reproduce locally, but not impact). Will open an issue to investigate