Investing into a pool
Last updated
Last updated
All investments are grouped by assetId.
0 = USDC
1 = EURT
2 = WETH
3 = WBTC
For each asset there are several investment strategies where funds can be allocated, as shown below in the diagram.
Investment happens in 3 steps:
We call executor encodeLiquidityCommand(codeName, percent)
to get ids and hashed messages. We can call it multiple times if we want to split the funds between different strategies.
βNB: the sum of percent should add up to 100 (10000 in the units passed to the function)
β‘οΈExample: we want to invest 60% of funds to Frax/Usdc pool and 40% to Mim+3CRV.
If we already have a position in other investment strategies corresponding to USDC, we should first exit those. For instance, if we had everything in Curve/FraxConvex Frax+USDC in the beginning, we should have called encodeLiquidityCommand('Curve/FraxConvex Frax+USDC', 0)
and included the hashed data into encodeAllMessages()
.
2. We call encodeAllMessages()
and pass the data from requests to get the inputData
, which we pass to submitData()
.
3. Finally, we call executeSpecificData()
which will withdraw the funds from the strategies if needed and then we call executeDeposits()