This guide will teach you how to find the correct liquidity pool instance to invest in, how to invest and get the respective tranche tokens in return, and how the whole system flows behind the scenes.
Pick the contracts deployed on the network you want to invest from.
You will need them on the
Step 2. below.
Circle USDC -
The user should call the ERC20 approval on the investment currency (e.g. USDC on Ethereum) to allow the Liquidity Pools contract to manage those funds for them.
Pick the correct
With the appropriate
PoolManager contract instance, call the following:
PoolManager.getLiquidityPool(poolId, trancheId, currency)
Invest into a LiquidityPool
Now that you have the LiquidityPool instance at hand, you can invest into it by calling:
LiquidityPool.requestDeposit(uint256 amount, address receiver)
Once submitted, the
amount is locked on the escrow contract.
Then, the pool issuer needs to fulfill this request.
Once that's done, yield starts to accrue immediately, and the user can claim their tranche tokens.
Claim the tranche tokens
Once the request from step 3 is fulfilled, the user can claim their tranche tokens equivalent to
y by calling:
LiquidityPool.mint(uint256 y, address receiver)
y needs to be ≤
maxDeposit. The user can find that amount by calling
Behind the scenes, this is what takes place on steps 2 and 3: