Open micahalcorn opened 3 years ago
Our current allocate structure will actually work as is for Uniswap. Allocate iterates over all assets and deposits in one strategy to maintain a target weight for that strategy. So adding a Uniswap strategy that supports DAI and USDT will have the result we want, a strategy that fills up with DAI and USDT. The deposit()
method of the strategy then provides liquidity in the Uniswap strategy by adding equal amounts of each coin according to the minimum.
In practice this is far from optimal, we will end up with very small amounts of DAI and much higher values of USDT, leaving a lot of uninvested USDT in the strategy. If we are looking at the DAI/USDC pool however, what we have might work fine.
I do think we should figure out a better approach, but I wanted to point out our existing setup would work for certain cases because I think we might be able to get to where we need to be with smaller changes than you might think.
Some ideas I'm tossing around:
deposit()
method on the strategy returns any assets it doesn't want to use and we attempt to provide that to the next strategy.balanced
flag on strategies where allocate attempts to provide the same values of each of the supported assets. I know this is not a requirement for Curve, but it seems optimal given the bonuses. In general, other platforms are probably want to receive balanced amounts of tokens so it might be a good implementation for general use.It seems like some of what may be required can be based off the calculateRedeemOutputs code.
Add a vault strategy that takes stablecoin deposits and supplies them to one or more of the following liquidity pools:
We will need to decide how to allocate deposits and withdrawals since Uniswap liquidity pools necessarily involve dealing with two tokens at a time as opposed to our Compound strategy, which can lend or withdraw any single token.