Ticks and Caps
Ticks are the mechanism that implements concentrated liquidity in Orbital AMM. Each tick provides liquidity only within a specific price range, defined geometrically as a spherical cap.
Tick Parameters
A tick is defined by two parameters (r, k):
- r — The sphere radius (liquidity provided by this tick)
- k — The hyperplane offset (defines the price range)
The tick's liquidity is active when reserves satisfy:
where v = (1/√n, ..., 1/√n). When x · v = k, the tick boundary is hit and the tick is exhausted.
The Hyperplane Constraint
Geometrically, x · v = k defines a hyperplane orthogonal to the equal-price direction. This hyperplane cuts off a "cap" from the sphere — like slicing off the top of a basketball.
The cap contains all reserve points where the tick is active. Outside the cap, the tick's liquidity is exhausted.
Tick Bounds
The valid range for k is:
k_max = r√n
At k_min, the cap just touches the depletion boundary (where one token is zero). At k_max, the cap is the entire sphere.
Virtual Reserves
The most complex part of tick math is computing the "virtual reserves" — what the reserves would be if this tick were the only liquidity source.
For a tick with parameters (r, k), the virtual reserve at the boundary is:
where c = nr − k√n
Derivation:
- At the boundary, x · v = k, so ∑ᵢxᵢ = k√n
- On the sphere, ∑ᵢ(r − xᵢ)² = r²
- By symmetry, at the cap edge, n−1 reserves are equal: x₂ = x₃ = ... = xₙ = y
- So x₁ + (n−1)y = k√n and (r − x₁)² + (n−1)(r − y)² = r²
- Solving this system gives the formula above
Interior vs Boundary
A tick has two states:
- Interior— Reserves are strictly inside the cap (x · v < k). The tick provides liquidity according to the sphere invariant.
- Boundary — Reserves are at the cap edge (x · v = k). The tick is exhausted; further trades in this direction must use another tick.
The contract tracks each tick's state in box storage. When a tick crosses from interior to boundary, the pool's consolidated state must be recomputed.
Price Range of a Tick
The price range covered by a tick is determined by k. At the lower boundary (k = k_min), the price is at the depeg threshold. At the upper boundary (k = k_max), the price is at parity.
For a depeg threshold of p (e.g., p = 0.99 for a 1% depeg), the corresponding k is:
This lets LPs specify price ranges in intuitive terms ("I want to provide liquidity between 0.99 and 1.01") rather than geometric terms.
Note:The virtual reserve formula is the trickiest derivation in Orbital. If you're implementing your own SDK, verify it against the reference Python implementation.