Implement a basic rebalancing flow
Opened this issue · 0 comments
jalextowle commented
This consists of taking a certain amount of liquidity to buy longs at a high rate and shorts at a low rate.
Much like John did with Everlong, I'll start by consuming all of the idle since I don't have a way to value the positions yet.
This is an interesting problem to solve. How do I break up a certain dollar amount into a long amount and a short amount?
- I should start with the easy way.
- The easy way to do it is to assume that the realized price will be approximately equal to the spot price. I can compute the adjusted spot price given the curve fee, and then I can use that to determine the split.
- The hard way to do it is to solve for the base amount such that the portion of base remaining is equal to the fixed rate that was paid. It would be good to have this problem solved for future reference.