This page contains the mathematical foundations and mechanics that underpin the system.
Most users do not need to read this section — it is intended for advanced users, integrators, and researchers.

Position Value Tracking

A leveraged position grows faster than its collateral. The relationship is: δVV=LδVcVc\frac{\delta V_*}{V_*} = L \cdot \frac{\delta V_c}{V_c} Where:
  • VV_* = value of the leveraged position
  • VcV_c = collateral value
  • LL = compounding leverage factor
Integrating: V(Vc)LV_* \propto (V_c)^L Example: If L=2L = 2 and the liquidity pool price is pLP=pp_{LP} = \sqrt{p}, then: V(p)2=pV_* \propto \left(\sqrt{p}\right)^2 = p This means the position tracks the underlying asset’s price exactly — while still earning fees.

APR Approximation

The expected return of the system can be approximated as: APR2rpool(rborrow+rloss)APR \approx 2r_{pool} - (r_{borrow} + r_{loss}) Where:
  • rpoolr_{pool} = yield from the base pool
  • rborrowr_{borrow} = borrowing cost
  • rlossr_{loss} = losses from rebalancing
APR is positive as long as the amplified pool yield exceeds costs.

Releverage Algorithm

To maintain constant leverage LL, the debt must stay aligned with collateral and oracle price pop_o: d~=L1Lpoy~\tilde{d} = \frac{L-1}{L} \, p_o \, \tilde{y} where y~\tilde{y} is the collateral amount at oracle parity. The system uses a modified AMM invariant: (x0(po)d)y=I(po)(x_0(p_o) - d)\,y = I(p_o) Solving for x0(po)x_0(p_o) leads to a quadratic expression: x0(po)=poy+po2y24poyd(L2L1)22(L2L1)2x_0(p_o) = \frac{p_o y + \sqrt{p_o^2 y^2 - 4\,p_o y d \left(\tfrac{L}{2L-1}\right)^2}}{2 \left(\tfrac{L}{2L-1}\right)^2} At parity (p=pop = p_o), the value of the pool is: V=x02L1V = \frac{x_0}{2L - 1} This formula is also used when calculating shares for deposits and withdrawals.

Deposits

When a user deposits:
  1. They provide cryptocurrency amount cinc_{in} and specify debt increment Δd\Delta d.
  2. The system borrows Δd\Delta d stablecoins and adds (Δd,cin)(\Delta d, c_{in}) to the pool, receiving LP tokens ll.
  3. New state variables (d+Δd,y+l)(d + \Delta d, y + l) are used to compute updated x0x_0 and pool value VV.
  4. Synthetic tokens are minted to the user proportional to the increase in VV.

Withdrawals

For a withdrawal of tt LP tokens (from total supply ss):
  • Collateral and debt are reduced by t/st/s.
  • Withdrawn LP tokens are redeemed such that stablecoins exactly match the reduced debt δd\delta d.
  • Any remaining crypto is returned to the user.
This ensures fairness: no one can “cherry-pick” debt/collateral ratios at exit.

Arbitrage & Virtual Pool

Arbitrageurs interact via a virtual pool that combines:
  • The releverage AMM,
  • The underlying liquidity pool,
  • Flash loans for stablecoins.
For stable → crypto swaps, the required flash amount ϕ\phi satisfies: ϕ2+ϕ(x0d+xry)yxr=0\phi^2 + \phi \big(x_0 - d + x - ry\big) - yx r = 0 with: r=xcSc(1f),D=b2+4yxr,b=x0d+xryr = \frac{x_c}{S_c}(1 - f), \quad D = b^2 + 4yxr, \quad b = x_0 - d + x - ry and solution: ϕ=12(Db)\phi = \tfrac{1}{2} \big(\sqrt{D} - b\big) Where:
  • ff = fee of the releverage AMM
  • dd = debt
  • yy = collateral amount
  • x0x_0 = oracle-derived state variable
  • xc,yc,Scx_c, y_c, S_c = reserves and supply in the base pool

Summary

  • Value growth follows V(Vc)LV_* \propto (V_c)^L
  • APR depends on pool yield vs. borrow + rebalance costs
  • Constant leverage is maintained by a dedicated releverage AMM
  • Deposits and withdrawals adjust both collateral and debt proportionally
  • Arbitrageurs ensure smooth operation via the virtual pool