Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more LM wrappers #944

Open
1 of 2 tasks
dmoka opened this issue Nov 5, 2024 · 0 comments
Open
1 of 2 tasks

Add more LM wrappers #944

dmoka opened this issue Nov 5, 2024 · 0 comments

Comments

@dmoka
Copy link
Contributor

dmoka commented Nov 5, 2024

We want to add more helper/wrappers extrinsics for our LMs:

TODO:

  • 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<T>,
	farm_entries: BoundedVec<(GlobalFarmId, YieldFarmId), T::MaxFarmEntriesPerDeposit>,
	asset: T::AssetId,
	amount: Balance,
	min_shares_limit: Balance,
)
exit_farms_and_remove_liquidity(
	origin: OriginFor<T>,
	deposit_id: DepositId,
	yield_farm_ids: BoundedVec<YieldFarmId, T::MaxFarmEntriesPerDeposit>,
)

exit_farms_and_remove_liquidity_with_limit(
	origin: OriginFor<T>,
	deposit_id: DepositId,
	yield_farm_ids: BoundedVec<YieldFarmId, T::MaxFarmEntriesPerDeposit>,
        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<T>,
                        stable_pool_id: T::AssetId,
			assets: Vec<AssetAmount<T::AssetId>>,
			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<T>,
                        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<T>,
			deposit_id: DepositId,
			asset_pair: AssetPair,
			farm_entries: BoundedVec<YieldFarmId, T::MaxFarmEntriesPerDeposit>,
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants