How it works

This page follows the Orbital paper (Paradigm, 2025) and shows where each idea lives in the program.

One point on a sphere

A pool holds n coins (2 to 16, MIN_ASSETS and MAX_ASSETS). Its reserves are a vector x = (x_1, ..., x_n). The pool keeps x on a sphere of radius r centred at (r, r, ..., r):

sum_i (r - x_i)^2 = r^2

No reserve can go below zero: the farthest a point on the sphere can be from the centre in any one direction is r.

Prices

The price of coin i in units of coin j is the slope of the sphere at the current point:

price(i in j) = (r - x_i) / (r - x_j)

A coin the pool holds a lot of is cheap; a coin it holds little of is expensive. When every reserve is equal, every price is 1. That is the equal price point, where every stablecoin sits when all trade at $1.

Bands are caps

A band is the set of points on the sphere within a fixed distance of the equal price point. Its edge is where the sphere meets a plane at right angles to the line from the centre through the equal price point. Seen on the sphere, it is a cap.

The width of a band follows from the price at which a single falling coin reaches its edge. For three coins drawn in 3D, those widths are:

BandAngle from the equal price point
$0.9990.027 degrees
$0.990.27 degrees
$0.951.37 degrees
$0.902.79 degrees
full35.26 degrees (where one price reaches 0)

A band never needs to hold more of a coin than its edge allows, so a liquidity provider deposits only what the band can actually reach. The paper calls the rest virtual reserves. For five coins, the paper gives about 15x capital efficiency for a $0.90 band and about 150x for $0.99.

Interior and pinned bands

At any moment each band is either:

The program stores every band's geometry in Band.beta, gamma, mu, sigma (Q64.64 fixed point) and its total radius in Band.radius. Interior bands combine into one sphere; pinned bands combine into a smaller sphere orthogonal to the equal price direction. The paper calls the combined shape a torus. Pool.tau stores where the pool sits between band edges.

A swap

swap(coin_in, coin_out, amount_in, min_out):

  1. Takes the fee: fee = ceil(amount_in * 200 / 1,000,000). 25% of it goes to Pool.protocol_fees, the rest is credited to bands by fee weight.
  2. Solves the trade on the combined shape for the net input (math::trade).
  3. If the trade reaches a band edge, it splits there, moves that band between interior and pinned, and continues. The number of crossings is reported in the Swapped event.
  4. Checks out >= min_out, moves the tokens, and asserts each vault still holds what the pool owes.

Rounding

Every rounding step favours the pool: deposits round up what you pay, withdrawals round down what you get, fees round up.

Next: Security and trust