-
Notifications
You must be signed in to change notification settings - Fork 25
4. Liquidity Pool
A liquidity pool can be set up by anyone (namely liquidity provider) to support trading of selected assets and leverages. Synthetic asset liquidity pools are different from margin trading pools in functionality, and risk mechanisms.
Find out more details on synthetic asset liquidity pools.
Find out more details on margin trading liquidity pools.
Below are simple guidelines for
Synthetic Asset Pools
- Create a pool
- Deposit/withdraw liquidity
- Enable synthetic token for trade
- Set up collateral ratio and spread
Margin Trading Pools
- Create a Pool
- Deposit/withdraw Liquidity
- Enable trading pairs
- Set up spread, swap and other parameters
Create a pool
Use Extrinsics call baseLiquidityPoolsForSynthetic.createPool()
Enable Trades
Use Extrinsics call syntheticLiquidityPools.setSyntheticEnabled(pool_id, currency_id, enabled)
Set Spread
Use Extrinsics call syntheticLiquidityPools.setSpread(pool_id, currency_id, bid, ask)
Deposit
Use Extrinsics call baseLiquidityPoolsForSynthetic.depositLiquidity(pool_id, amount)
Withdraw
Use Extrinsics call baseLiquidityPoolsForSynthetic.withdrawLiquidity(pool_id, amount)
Pools have a default additional collateral ratio
say 0.1
- meaning that for a $100 fEUR swap, users would put up $100 dollar worth of collateral to mint fEUR, while the synthetic asset pool will put up an additional 10% to counter price fluctuation. But this value can be overridden by individual pools, using Extrinsic call syntheticLiquidityPools.setAdditionalCollateralRatio(pool_id, currency_id, ratio)
Use Extrinsics call baseLiquidityPoolsForMargin.createPool()
Enable trading pairs
Use Extrinsics call marginLiquidityPools.liquidityPoolEnableTradingPair(pool_id, pair)
Enable leverage
Use Extrinsics call marginLiquidityPools.setEnabledLeverages(pool_id, pair, enabled)
[Note] currently there's an issue with Polkadot{js}, but this can be done via Laminar's sdk with something like marginLiquidityPools.setEnabledLeverages(3, ['FEUR', 'AUSD'], 0x1f1f)
Note that the leverage field is a bit mask represented in hex 0x1f1f
as 0b0001111100011111
to support 2, 3, 5, 10 and 20 times long and short margin trading.
See more details on leverage bit mask here
Set up spread, swap and other parameters
Use Extrinsics call marginLiquidityPools.setSpread(pool_id, pair, bid, ask)
Deposit
Use Extrinsics call marginLiquidityPools.depositLiquidity(pool_id, amount)
Liquidity pool will require initial deposit for it to be operational.
Withdraw
Use Extrinsics call marginLiquidityPools.depositLiquidity(pool_id, amount)
Only the amounts that are not used as collateral can be withdrawn.
Navigate to the Liquidity Pool
page to see all pools available, their respective supported trading pairs and spreads, and also trade from there.
We do not provide a user interface for creating and setting up a pool at this stage. If you'd like to become a liquidity provider, please get in touch.