Rebalancing
HyperAMM maintains a target liquidity composition of 2/3 on EVM and 1/3 on Core. The rebalancing system automatically adjusts when this ratio drifts.
Why Rebalance?
As swaps occur, the EVM pool's token balances shift. The pool may accumulate too much of one token and too little of another, moving away from the ideal 2/3-1/3 split. Rebalancing:
- Restores optimal liquidity distribution
- Ensures sufficient collateral on Core for hedging
- Maintains pool health and trading efficiency
6-State Rebalancing Machine
The rebalancer operates as a state machine with six states, orchestrated by an automated keeper:
- Idle — Composition is within acceptable bounds
- Deposit Pending — Assets are being bridged from EVM to Core
- Trading — Spot/perp trades executing on Core to adjust positions
- Perp Withdrawal Pending — Waiting for Core perp withdrawals to complete
- Withdraw Pending — Assets are being bridged from Core back to EVM
- Emergency — Triggered when anomalies are detected; halts automation
The keeper monitors pool state and triggers transitions when composition drifts beyond configured thresholds.
Emergency Mode
If the rebalancer detects an anomaly — such as failed hedge orders, unexpected position changes, or extreme market conditions — it enters emergency mode:
- All automated operations pause
- Protocol operators are alerted
- Manual intervention may be required to resume
This is a safety mechanism that prioritizes capital preservation over continued operation.
Rebalancing Impact on LPs
Rebalancing is transparent to LPs:
- No action required — fully automated
- Minor costs from bridging and trading are absorbed by the pool
- Pool composition and rebalancer state are visible on-chain
Next Steps
- Liquidity Pools — Pool composition and LP mechanics
- Delta Hedging — How hedges are maintained during rebalancing