galacticcouncil / galacticcouncil/hydration-node
Add more LM wrappers
- Dominant language
- Rust
- Stars
- 208
- Forks
- 109
- Avg merge
- 6d 3h
- Merged PRs (30d)
- 3
Description
We want to add more helper/wrappers extrinsics for our LMs:
TODO:
- [x] finish spec and discuss it with UI team
- [ ] if we want to add an optional `amount` for removing liquidity, otherwise we remove all linked to the positions
TODO: add remove liquidty form omnipool and stablesawp
- add optional field for amount
Here are the new APIs:
## Omnipool LM
```
DONE
add_liquidity_with_limit_and_join_farms(
origin: OriginFor,
farm_entries: BoundedVec<(GlobalFarmId, YieldFarmId), T::MaxFarmEntriesPerDeposit>,
asset: T::AssetId,
amount: Balance,
min_shares_limit: Balance,
)
```
```
exit_farms_and_remove_liquidity(
origin: OriginFor,
deposit_id: DepositId,
yield_farm_ids: BoundedVec,
)
```
```
exit_farms_and_remove_liquidity_with_limit(
origin: OriginFor,
deposit_id: DepositId,
yield_farm_ids: BoundedVec,
min_limit: Balance
)
```
```
DONE
///Steps for the behaviour
///1. add proportional liquidty to stableswap, so we get 2pool share token
///2. add this 2pool share token as liquidity to omnipool so we get some shares
///3. enter to farms with these omnipool shares.
add_liquidity_stableswap_omnipool_and_join_farms(
origin: OriginFor,
stable_pool_id: T::AssetId,
assets: Vec>,
farm_entries: BoundedVec<(GlobalFarmId, YieldFarmId), T::MaxFarmEntriesPerDeposit>,
)
```
```
WON'T BE IMPLEMENTED
///Steps for the behaviour
///1. add liquidty to stableswap, so we get 2pool share token
///2. add this 2pool share token as liquidity to omnipool so we get some shares
///3. enter to farms with these omnipool shares.
add_liquidity_one_asset_stableswap_omnipool_and_join_farms(
origin: OriginFor,
stable_pool_id: T::AssetId,
asset_id:T::AssetId,
amount: Balance,
farm_entries: BoundedVec<(GlobalFarmId, YieldFarmId), T::MaxFarmEntriesPerDeposit>,
)
```
```
exit_farms_and_remove_liquidity_omnipool_stableswap
```
```
WON'T BE IMPLEMENTED
exit_farms_and_remove_liquidity_one_asset_omnipool_stableswap
```
## XYK LM:
```
exit_farms_and_remove_liquidity(
origin: OriginFor,
deposit_id: DepositId,
asset_pair: AssetPair,
farm_entries: BoundedVec,
)
```
Contributor guide
Assessment
This issue has not been assessed yet.