Math deep dive
Position constructing
1'st subPosition (borrowing notional)
2'nd subPosition (borrowing asset)
Delta-neutrality condition
Generalized equation for delta of position
Rebalancing
Definitions in terms of typical LYF-protocol interface (Tulip, Francium, Alpaca, Tarot)

Positions' and debts' values after rebalancing:
How to calculate those value changes:
The result
This cash flows totally define the algorythm of rebalancing in general. It can be implemented in any LYF protocol after fitting to protocol's interface.
Here is the backtesting result of sample strategy, using Francium's SOL-USD pool characteristics with 3'rd leverage:

Last updated