1'st subPosition (borrowing notional)
2'nd subPosition (borrowing asset)
Delta-neutrality condition
that's why we put N/4 in first subPosition and 3N/4 in second.
Generalized equation for delta of position
Definitions in terms of typical LYF-protocol interface (Tulip, Francium, Alpaca, Tarot)
Positions' and debts' values after rebalancing:
How to calculate those value changes:
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: