Skip to content

add new extrinsic for removing stableswap liquidity from omnipool lp/omnipool lp in farm #1294

@DuriSK

Description

@DuriSK

It would be great to have extrinsic(s) which will calculate for UI necessary balances when removing stableswap shares from either omnipool position or omnipool farming position.
This is currently handled in 3 signing steps.

Revert OmnipoolLiquidityMining.addLiquidityStableswapOmnipoolAndJoinFarms
depositId
list of farms (because you can be in multiple farms)

Omnipool liquidity (in farm)=>omnipoolLiquidityMining.withdrawShares(args)=>Omnipool LP position(not in farm)=>omnipool.removeLiquidityWithLimit(args)=>stableswap shares=>remove proportionally/single asset=> assets

example of proportional liquidity removal (from stableswap)l:

{
"args": {
"pool_id": "102",
"share_amount": "9,868,770,921,034,374,665",
"min_amounts_out": [
{
"assetId": "10",
"amount": "4,917,091"
},
{
"assetId": "22",
"amount": "4,983,877"
}
]
},
"method": "removeLiquidity",
"section": "stableswap"
}

example of single side removal(from stableswap):

{
"args": {
"pool_id": "102",
"asset_id": "22",
"share_amount": "9,868,770,921,034,374,665",
"min_amount_out": "9,898,643"
},
"method": "removeLiquidityOneAsset",
"section": "stableswap"
}

  1. omnipool position in farm => omnipool position (not in farm)=>stableswap shares=>asset
  2. omnipool position (not in farm)=>stableswap shares=>asset

2 options how to withdaw shares from stablepool :

  • proportionally
  • single asset

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions