CompliFi
Search…
Liquidity Operations
In all structures below, rollover_hints_list can be left empty

Adding Liquidity

join method is used to add collateral to a pool in exchange for pool share ERC20 tokens.
seth send $POOL "joinSimple(uint256,uint256)" $COLLATERAL_AMOUNT $MIN_POOL_SHARE_AMOUNT_OUT
seth send $POOL "join(uint256,uint256,tuple[])" $COLLATERAL_AMOUNT $MIN_POOL_SHARE_AMOUNT_OUT $ROLLOVER_HINTS_LIST

Removing Liquidity

Removing liquidity from a pool is a two-step process. First, exit method creates a redemption request and adds it to Redemption Queue. The queue is processed automatically when users interact with the protocol and free collateral becomes available. Once that happens, the queued request is converted to Released Liquidity - an amount of collateral available to withdraw at any time. This can be done using withdrawReleasedLiquidity method.
Note: if enough free collateral is available when the request is made, then the entire process above happens atomically.
seth send $POOL "exitSimple(uint256)" $POOL_SHARE_AMOUNT
seth send $POOL "join(uint256,tuple[])" $POOL_SHARE_AMOUNT $ROLLOVER_HINTS_LIST
seth send $POOL "withdrawReleasedLiquidity(uint256)" $COLLATERAL_AMOUNT