goldfinch-eng/mono

Partial sweep to Compound

Opened this issue · 0 comments

One feature that would be awesome is the ability to sweep some funds to Compound, so that idle capital in the Senior Pool can be earning additional yield. And in fact, we already built this! However, for simplicity reasons, we built it such that it always sweeps all idle capital to Compound. And then if an LP withdraws, it would sweep it all back, and give the LP whatever the need. It required a manual action to sweep the funds back into Compound. We could have also swept the capital right back to Compound within the same withdraw transaction, but the gas costs would have been insane.
This was all fine in the very early days because we didn't have many LP's. But now that we have over 4800 LPs, withdraws happen multiple times/day, which basically breaks the feature.

So what would be awesome is the ability to sweep some funds to Compound (eg. 90% of available funds), so that 10% remains as liquidity for LPs. And only if someone wants to withdraw more than what remains at once would it trigger the withdraw back. This makes the accounting more difficult, but this feature would be very valuable! The core code to make it happen is already present here and here.