interbtc icon indicating copy to clipboard operation
interbtc copied to clipboard

Atomically lock vault collateral in lending market and re-lock as vault collateral

Open nud3l opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe. With the introduction of the lending market and adding qTokens as collateral to the bridge, vaults are able to e.g., lock DOT in the lending market, obtain qDOT tokens and then use the qDOT as bridge collateral.

However, to move their existing DOT locked as bridge collateral (that is used to back BTC), vaults would have to do self-replace requests:

  1. Withdraw free DOT from the bridge
  2. Convert DOT to qDOT and lock qDOT as bridge collateral
  3. Replace a portion of the DOT collateral with the newly locked qDOT including a Bitcoin transaction
  4. Repeat step 1 to 3 until entire DOT vault is moved to the qDOT vault

Describe the solution you'd like Instead of doing the multiple steps above, allow vaults that have DOT collateral locked and reserved by users to automatically replace the collateral with a qToken, i.e., allow vaults to replace their DOT vault with a qDOT vault or a USDT with a qUSDT vault.

In a single atomic transaction:

  1. Unlock 100% of DOT from bridge collateral
  2. Lock 100% of DOT in lending protocol and obtain qDOT
  3. Lock 100% of qDOT as bridge collateral

Do not require a Bitcoin transaction as it would not be a replace request.

Describe alternatives you've considered None.

Additional context For the launch of the BTC staking product, having DOT and KSM liquidity in the lending market would be ideal. The Interlay and Kintsugi network already have large KSM and DOT liquidity locked as bridge collateral. This feature would unlock said bridge collateral and make it available in lending and serve as an enabler for the BTC staking product.

nud3l avatar May 26 '23 07:05 nud3l