interbtc
interbtc copied to clipboard
Fix the loans reserve
Describe the bug
Currently, the reserve cash does not contribute to market liquidity. There is a mismatch between the implementation in the interbtc loans
pallet and that in Compound v2. This PR further documents the issue and is an initial attempt at fixing the problem.
Also see my questions in the Compound Discord:
- Why reserves exist: https://discord.com/channels/402910780124561410/402912055448961034/1065644672988483664
- Why borrows (and not just redeems) are allowed to use reserve cash: https://discord.com/channels/402910780124561410/402912055448961034/1065932585747877939
Expected behavior
Without the reserve contributing to protocol liquidity, the add_reserves
extrinsic has no utility and should be removed. Otherwise, the reserve should serve as a way for protocol governance to add exit liquidity for redeemers in case 100% utilization is achieved.
Context See these associated code TODOs:
- https://github.com/interlay/interbtc/blob/f0a0144a0cd7e512bf9b2c55e57b12e4b3b5e9c4/crates/loans/src/lib.rs#L1149
- https://github.com/interlay/interbtc/blob/f0a0144a0cd7e512bf9b2c55e57b12e4b3b5e9c4/crates/loans/src/lib.rs#L1721