Deprecated: [Patch] Add Mimirs to inhibit LP deposits (global and per-chain)

#2152 demonstrates the need to inhibit LP deposits, whilst still permitting withdrawals.

As of this writing, the only reason LP deposits aren't permitted is because TC is underbonded. We therefore run the risk of BPs adding RUNE to the network, thus becoming equal/overbonded, thus allowing LP deposits to happen, thus affecting synth leverage and impacting DLPs. We therefore need a mechanism to inhibit LP deposits to keep this from happening.

This patch, through Mimirs PAUSEDEPOSITLP (global that affects all chains), and PAUSEDEPOSITLP<Chain> (on a per-chain basis), allow exactly that.

This code is based off of the PAUSELP code, but is only operationally implemented within x/thorchain/handler_add_liquidity.go for deposits/adds.

We should probably try to get this slated for THORNode 3.3.0 (i.e. the sooner the better).

NOTE: Tests do pass via make test-all, but due to resource constraints on my own systems, I am unable to run a mocknet to test it live. If someone could test this on mocknet (including THORNode API results), I would appreciate it.

Edit: one comment in passing: devs might wonder why the Mimirs prefix is PAUSEDEPOSITLP and not PAUSELPDEPOSIT. This is because the latter would conflict with PAUSELP<Chain> in the case we ever had a chain named DEPOSIT.

Edited by koitsu

Merge request reports

Loading