Expand description
Functions§
- add_
liquidity - Provide liquidity into the pool of
asset1andasset2. NOTE: an optimal amount of asset1 and asset2 will be calculated and might be different than the providedamount1_desired/amount2_desiredthus you should provide the min amount you’re happy to provide. Paramsamount1_min/amount2_minrepresent that.mint_towill be sent the liquidity tokens that represent this share of the pool. - create_
pool - Creates an empty liquidity pool and an associated new
lp_tokenasset (the id of which is returned in theEvent::PoolCreatedevent). - remove_
liquidity - Allows you to remove liquidity by providing the
lp_token_burntokens that will be burned in the process. With the usage ofamount1_min_receive/amount2_min_receiveit’s possible to control the min amount of returned tokens you’re happy with. - swap_
exact_ tokens_ for_ tokens - Swap the exact amount of
asset1intoasset2.amount_out_minparam allows you to specify the min amount of theasset2you’re happy to receive. - swap_
tokens_ for_ exact_ tokens - Swap any amount of
asset1to get the exact amount ofasset2.amount_in_maxparam allows to specify the max amount of theasset1you’re happy to provide. - touch
- Touch an existing pool to fulfill prerequisites before providing liquidity, such as ensuring that the pool’s accounts are in place. It is typically useful when a pool creator removes the pool’s accounts and does not provide a liquidity. This action may involve holding assets from the caller as a deposit for creating the pool’s accounts.