Animation by Dave Whyte

Introduction

The future holds a million stablecoins. Today's infrastructure isn't ready.

This paper introduces Orbital, an automated market maker for pools of 2, 3, or 10,000 stablecoins.

Orbital unlocks capital efficiency by bringing concentrated liquidity to higher dimensions.

Overview

This is a graph of the reserves of an automated market maker (AMM) between USDC and USDT. When traders add USDT, they get USDC in return. In the middle, where reserves are equal, the coins have the same price. At the edges, one is worthless compared to the other.

Uniswap V3 pioneered the concept of concentrated liquidity. It creates and consolidates mini-AMMs, called ticks, that support more trading with less capital by restricting themselves to only a specified price range. Uniswap v3 allows liquidity providers to create positions between any two tick boundaries, and efficiently aggregates their liquidity so that traders can interact with it as if it were a single pool. However, it only supports pools between two assets.

Curve created an invariant-based AMM that allows trading of N stablecoins in a single pool. It focuses liquidity around the price of 1. However, Curve uses a uniform strategy for each pool, meaning all liquidity providers in the same pool have the same liquidity profile.

Orbital extends customizable concentrated liquidity to pools of three or more stables by drawing tick boundaries as orbits around the $1 equal price point.

Unlike in 2D concentrated liquidity, even if one stablecoin depegs to 0, an Orbital tick can still trade the others at fair prices.

Smaller ticks closer to the equal $1 price point don't need to hold capital in reserve to give out in case one of the coins depegs.

This lets LPs focus their resources where normal trading actually happens, unlocking significant capital efficiency gains.

The full Orbital AMM combines ticks of different sizes so LPs can customize their exposures.

Some might choose to focus narrowly around the $1 point for maximum efficiency, while others might provide wider coverage to earn fees during times of volatility.

Under the hood, Orbital ticks are

nn
-dimensional spherical caps.

Thanks to symmetry, we can orbit some around the others to obtain a single toroid (donut-like) shape.

This lets us compute trades efficiently onchain regardless of the number of different coins in the pool.

Intuition

The math below gets pretty dense, but it's just trying to formalize a relatively simple visual intuition.

In the 3D case, depicted above, the base Orbital AMM is a sphere. We only show 1/8th of the sphere in the animation because it's the only relevant part assuming prices stay non-negative.

The Orbital tick in the diagram refers to the part of the sphere inside the red circle. The red circle itself forms the boundary of the tick. Note that, unlike in Uniswap V3, Orbital ticks actually overlap, so that larger ones fully contain smaller ones.

We can see from the animation that a Orbital tick can be in one of two states. If prices for all the stablecoins are sufficiently close to the equal $1 price point, then the reserves will be somewhere on the interior tick. But once prices have diverged enough, the tick's reserves will become pinned to its boundary.

Now, imagine we have hundreds or thousands of ticks. Each one of them will either be an "interior tick" or a "boundary tick."

Locally, all interior ticks behave like spheres. Since they are geometrically similar, we can consolidate them all and treat them like a single sphere.

Similarly, all boundary ticks behave locally like circles (in general, in

nn
dimensions, they behave like
n1n-1
-dimensional spheres. Since they are geometrically similar, we can again consolidate them all and treat them like a single circle.

Logically speaking, we are now dealing with one spherical AMM and one circular AMM. By rotating the sphere around the circle, we obtain a single torus, or donut shape.

The equation of this torus is simple enough that we can compute trades across its surface efficiently onchain. To compute larger trades, we update the equation every time a tick changes from boundary to interior or vice versa.

Luckily, all of this stays true in high-dimensional space, and the rest of the paper goes into the details of how that works.

Mechanism

The Sphere AMM

Formula

Orbital is built on top of the Sphere AMM

rx2=i=1n(rxi)2=r2||\vec{r}-\vec{x}||^2=\sum_{i=1}^n (r-x_i)^2 = r^2

where

xix_i
is AMM's reserve of asset
ii
.

To see that the minimum reserve of any asset is

00
, note that the sphere is centered at
r=(r,r,,r)\vec{r} = (r, r, \dots, r)
, and the farthest a point on the sphere can be from the center in any dimension is the radius
rr
.

As long as asset prices are positive, no-arbitrage implies we should never have reserves

xi>rx_i > r
for any
ii
, since if
xi=r+dx_i=r+d
for some
d>0d>0
, then
(rxi)2=d2=(r(rd))2=(r(xi2d))2(r - x_i)^2 = d^2 = (r - (r - d))^2 = (r - (x_i - 2d))^2

and some trader could remove

2d2d
of asset
ii
for free without affecting the AMM's constant function constraint, and by assumption it would have positive value. Therefore we won't add an explicit contraint for
xirx_i \leq r
to the AMM, but can assume that
xirx_i \leq r
for all
ii
in normal circumstances.

Token Prices on the Sphere

Let's say a trader wants to give the AMM some token

XiX_i
and take out some token
XjX_j
while staying on the surface
F(x)=rx2=r2F(\vec{x}) = ||\vec{r} - \vec{x}||^2 = r^2

In this case, we must have

δFδxiδxi+δFδxjδxj=0\frac{\delta F}{\delta x_i} \delta x_i + \frac{\delta F}{\delta x_j} \delta x_j = 0

so, abusing notation a bit, we can express the instantaneous price of one unit of

xjx_j
as

δxiδxj=δFδxj/δFδxi=rxjrxi\frac{\delta x_i}{\delta x_j} = -\frac{\delta F}{\delta x_j} / \frac{\delta F}{\delta x_i} = \frac{r - x_j}{r - x_i}

Intuitively we can verify that if the AMM has high reserves of

XjX_j
and low reserves of
XiX_i
, this fraction will be small, meaning you don't get much
XiX_i
per unit of
XjX_j
, and vice versa.

The Equal Price Point

The most important point on the surface of our AMM is the point where all reserves are equal, so that, by symmetry, all prices are equal.

This should be the the normal state for stablecoins, because under normal conditions they should all worth the value they are pegged to, e.g. $1.

Let's denote this point

q=(q,q,,q)\vec{q} = (q, q, \ldots, q)

By our sphere constraint, we have

r2=rq2=i=1n(rq)2=n(rq)2r^2 = \|\vec{r} - \vec{q}\|^2 = \sum_{i=1}^n (r - q)^2 = n(r - q)^2

So then

(rq)2=r2nrq=rn(r - q)^2 = \frac{r^2}{n} \Rightarrow r - q = \frac{r}{\sqrt{n}}

so

q=r(11n)q = r\left(1 - \sqrt{\frac{1}{n}}\right)

and we have

q=r(11n)(1,1,,1)\vec{q} = r\left(1 - \sqrt{\frac{1}{n}}\right)(1, 1, \dots, 1)

Since they're all multiples of

(1,1,,1)(1, 1, \dots, 1)
, there's a line from the origin, through the equal price point, and to the center of the AMM. We can represent its direction with the unit vector

v=1n(1,1,,1)\vec{v} = \frac{1}{\sqrt{n}} (1, 1, \dots, 1)

In terms of trading, we can think of

v\vec{v}
as a portfolio of
1n\frac{1}{\sqrt{n}}
of each of the coins in the AMM.

Polar Reserve Decomposition

This section introduces a concept and notation we'll be using to work with ticks through the rest of the paper.

Given any valid reserve state

x\vec{x}
on the surface of the AMM, linear algebra tells us we can decompose it into a vector parallel to
v\vec{v}
and a vector
w\vec{w}
orthogonal to
v\vec{v}
, the vector from the origin to the equal price point.

In other words, for any reserve state

x\vec{x}
, we have

x=αv+wwherevw\vec{x} = \alpha \vec{v} + \vec{w} \quad \text{where} \quad \vec{v} \perp \vec{w}

Note that because

v\vec{v}
is a unit vector, we can calculate
α\alpha
directly as
xv\vec{x} \cdot \vec{v}
, which mechanically equals
1ni=1nxi\frac{1}{\sqrt{n}} \sum_{i=1}^n x_i
1n\frac{1}{\sqrt{n}}
times the sum of all reserves in
x\vec{x}
.

Viewed through the lens of this decomposition, our AMM constraint becomes

r2=xr2=(αv+w)r12=(αv+w)rnv2=(αrn)v+w2r^2 = \|\vec{x} - r\|^2 = \|(\alpha \vec{v} + \vec{w}) - r \cdot \vec{1}\|^2 = \|(\alpha \vec{v} + \vec{w}) - r \sqrt{n} \cdot \vec{v}\|^2 = \|(\alpha - r \sqrt{n}) \vec{v} + \vec{w}\|^2

Since

vw\vec{v} \perp \vec{w}
by definition, we can use the Pythagorean theorem to simplify this to

r2=(αrn)2+w2r^2 = (\alpha - r\sqrt{n})^2 + \|\vec{w}\|^2

or, rearranging,

w2=r2(αrn)2\|\vec{w}\|^2 = r^2 - (\alpha - r\sqrt{n})^2

From this, we can see that if we hold the component of reserves parallel to

v\vec{v}
constant, our AMM acts as a lower-dimensional spherical AMM in the subspace orthogonal to
v\vec{v}
with radius

s=r2(αrn)2s = \sqrt{r^2 - (\alpha - r\sqrt{n})^2}

Tick Definition

Notes

In the interest of simplicity, for the rest of the paper we will act as if each tick has only one liquidity provider. Of course, in practice, we would allow multiple LPs to pool their liquidity into the same tick, just like in Uniswap V3.

As a reminder, ticks in Orbital are nested. Each is centered at the equal price point, and larger ticks fully overlap with smaller ticks. This is in contrast to Uniswap V3, where ticks are fully disjoint.

Geometric Intuition

We can think of a tick geometrically as all the points on the sphere's surface that are within some fixed geodesic distance from the equal-price point.

In the 3D case visualized above, it's possible to intuit that we can construct the boundary of such a tick by slicing the sphere with a plane orthogonal to the vector

v\vec{v}
from the equal price point to the sphere's center.

We formalize this construction for higher dimensions below.

Tick Boundary Geometry

Any plane normal to

v=(1n,1n,,1n)Rn\vec{v} = \left( \frac{1}{\sqrt{n}}, \frac{1}{\sqrt{n}}, \dots, \frac{1}{\sqrt{n}} \right) \in \mathbb{R}^n
has the form

xv=k\vec{x} \cdot \vec{v} = k

This is another way of saying that the plane consists precisely of all points whose projection on

v\vec{v}
is
kk
-- i.e. the points of the form
kv+wk\vec{v} + \vec{w}
for some
wv\vec{w} \perp \vec{v}
, which you get by starting from
kvk\vec{v}
and adding some vector orthogonal to
v\vec{v}
.

From the polar reserve decomposition section above, we can see that when reserves lie on this boundary, since the component of reserves parallel to

v\vec{v}
is constant at
kvk\vec{v}
, the tick AMM functions as a spherical AMM in the
n1n-1
-dimensional subspace orthogonal to
v\vec{v}
with radius
s=r2(krn)2s = \sqrt{r^2 - (k - r\sqrt{n})^2}
and center
(krn)v(k - r\sqrt{n})\vec{v}
.

By symmetry, every point on this boundary will have an equal geodesic distance from the equal price point.

Tick Size Bounds

This section is relatively technical and defines the sizes of the smallest and largest ticks that make sense.

The Minimal Tick

The minimal tick boundary would be the equal price point itself, which we derived above as the point

q\vec{q}
where

xi=r(11n)x_i = r\left(1 - \sqrt{\frac{1}{n}}\right)

for all

ii
.

In that case

x1=r(nn)\vec{x} \cdot \vec{1} = r(n - \sqrt{n})
, and since
v=1n1\vec{v} = \frac{1}{\sqrt{n}} \vec{1}
, we can define this tick using the plane constant

kmin=xv=x1n=r(n1)k_{\text{min}} = \vec{x} \cdot \vec{v} = \frac{\vec{x} \cdot \vec{1}}{\sqrt{n}} = r(\sqrt{n} - 1)

The Maximal Tick

The maximal tick's boundary is defined by the plane that lets us achieve the highest possible value of

xv\vec{x} \cdot \vec{v}
that doesn't require any reserve
xix_i
to go above
rr
. This happens when one reserve
xjx_j
reaches its minimum value of 0 while all other reserves are at the maximum,
rr
.

For example, consider

x1=0x_1 = 0
and
x2=x3==xn=rx_2 = x_3 = \cdots = x_n = r
.

It's still on the sphere because

i=1n(rxi)2=r2+i=2n(rr)2=r2\sum_{i=1}^n (r - x_i)^2 = r^2 + \sum_{i=2}^n (r - r)^2 = r^2

and we have

kmax=xv=0+(n1)rn=rn1nk_{\text{max}} = \vec{x} \cdot \vec{v} = \frac{0 + (n - 1)r}{\sqrt{n}} = r \frac{n - 1}{\sqrt{n}}

To see that this is indeed the maximal tick boundary, note that the reserves of all tokens but

X1X_1
are already at their maximum of
rr
assuming positive prices. So, the only way we might be able to increase
xv\vec{x} \cdot \vec{v}
further would be to increase the reserves of
X1X_1
while decreasing the other reserves by a lesser amount so that we don't violate the AMM constant.

But note that the gradient of

rx2\|\vec{r} - \vec{x}\|^2
is

2(rx)=(r,0,,0)2(\vec{r} - \vec{x}) = (r, 0, \ldots, 0)

at this point. So if the AMM reduces its

x2x_2
reserves infinitesimally, because of the 0 gradient we won't decrease the value of the AMM constant
xr2\|\vec{x} - r\|^2
at all. That means so we can't increase
x1x_1
to compensate, and this indeed is the maximum tick boundary.

Tick Reserve Bounds and Virtual Reserves

This section explores how tick boundaries affect the minimum and maximum token reserves a tick can hold, and the implications that has for capital efficiency.

Minimum Reserves

Consider an Orbital tick with a plane constraint of

xv=k\vec{x} \cdot \vec{v} = k

Let's derive the minimum possible reserves of any one of the coins, which we'll denote as

XminX_{\text{min}}
. By symmetry, the reserves of all the other
XotherX_{\text{other}}
must be equal to one another at that point.

Our sphere constraint then becomes

(rxmin)2+(n1)(rxother)2=r2(r - x_{\text{min}})^2 + (n - 1)(r - x_{\text{other}})^2 = r^2

and our plane invariant becomes

1n((n1)xother+xmin)=k\frac{1}{\sqrt{n}} \left( (n - 1)x_{\text{other}} + x_{\text{min}} \right) = k

so that

xother=nkxminn1x_{\text{other}} = \frac{\sqrt{n}k - x_{\text{min}}}{n - 1}

Solving the resulting quadratic equation for

xminx_{\text{min}}
we get

xmin=knk2nn((n1)rkn)2nx_{\text{min}} = \frac{k\sqrt{n} - \sqrt{k^2 n - n\left((n - 1)r - k\sqrt{n}\right)^2}}{n}

In terms of trading, this will usually represent the situation where all coins but one depeg to a low value, causing traders to remove as much of that still-stable coin as they can from the AMM.

Virtual Reserves

No matter what traders do, they cannot force the reserves of any token

XiX_i
to fall below
xminx_{\text{min}}
.

This means the liquidity provider creating the tick can act as if they have "virtual reserves" of

xminx_{\text{min}}
of each of the stablecoins the tick trades and don't actually need to provide those
xminx_{\text{min}}
tokens when creating the tick. As in Uniswap V3, this is what allows for the capital efficiency we will discuss below.

Maximum Token Reserves

We can repeat the above derivation but flip the sign of the square root to find the maximum quantity of any given coin in the tick assuming both constraints are binding.

Since, if prices are positive, no coin balance will go above

rr
, we can then define

xmax=min(r,kn+k2nn((n1)rkn)2n)x_{\text{max}} = \min\left(r, \frac{k\sqrt{n} + \sqrt{k^2 n - n\left((n - 1)r - k\sqrt{n}\right)^2}}{n}\right)

and

xother=nkxmaxn1x_{\text{other}} = \frac{\sqrt{n}k - x_{\text{max}}}{n - 1}

In terms of trading, this will normally represent the situation where one single coin loses its peg and falls in value, while the other coins remain stable, causing traders to give the AMM as much of that one coin as they can. We call this a single-depeg event.

Interpreting k

If we assume that the most common way things will "go wrong" is a single depeg event of the type described in the section immediately above, then for small enough

kk
we are concentrating liquidity where no coin has yet depegged down to a certain threshold -- for example, the area where no coin has depegged to below 99 cents.

Assuming only one coin depegs and the rest stay constant, and that

kk
is small enough that the plane constaint is binding, the depegged coin will have reserves of

xdepeg=kn+k2nn((n1)rkn)2nx_{\text{depeg}} = \frac{k\sqrt{n} + \sqrt{k^2 n - n\left((n - 1)r - k\sqrt{n}\right)^2}}{n}

and

xother=knxdepegn1x_{\text{other}} = \frac{k\sqrt{n} - x_{\text{depeg}}}{n - 1}

Recall from the section on pricing that the instantaneous price of token

XjX_j
with respect to token
XiX_i
is

δxiδxj=δFδxj/δFδxi=rxjrxi\frac{\delta x_i}{\delta x_j} = -\frac{\delta F}{\delta x_j} \bigg/ \frac{\delta F}{\delta x_i} = \frac{r - x_j}{r - x_i}

In that case, the tick boundary corresponds to the single token depegging to

pdepeg=rxdepegrxotherp_{\text{depeg}} = \frac{r - x_{\text{depeg}}}{r - x_{\text{other}}}

We can then invert this to obtain, for a given

pdepegp_{\text{depeg}}
, the
kk
such that the boundary kicks in exactly at that depeg price:

kdepeg(pdepeg)=rnr(pdepeg+n1)n(pdepeg2+n1)k_{\text{depeg}}(p_{\text{depeg}}) = r\sqrt{n} - \frac{r(p_{\text{depeg}} + n - 1)}{\sqrt{n(p_{\text{depeg}}^2 + n - 1)}}

Note that for large-enough

kk
, such as
kmaxk_{\text{max}}
, the tick will remain fully in-range as multiple coins depeg all the way to 0, so this interpretation won't be relevant there and we are better of thinking about metrics like maximum portfolio loss assuming all coins but one depeg.

Capital Efficiency

As we derived above, given a plane constant

kk
, the LP of a given tick gets to take advantage of virtual reserves

xmin(k)=knk2nn((n1)rkn)2nx_{\text{min}}(k) = \frac{k\sqrt{n} - \sqrt{k^2 n - n\left((n - 1)r - k\sqrt{n}\right)^2}}{n}

for each of the

nn
assets. If we assume they create the AMM when reserves are at the equal price point
q\vec{q}
, the reserves they would need to provide for each coin in the spherical AMM would be

xbase=r(11n)x_{\text{base}} = r\left(1 - \sqrt{\frac{1}{n}}\right)

So, assuming prices never diverge enough to push reserves past the boundary of the tick, there is a capital efficiency gain of

xbasexbasexmin(k)\frac{x_{\text{base}}}{x_{\text{base}} - x_{\text{min}}(k)}

Using the depeg price formula from the prior section, we can compute how much capital efficiency you get by picking a boundary corresponding to a max depeg price of

pp
:

cefficiency(p)=xbasexbasexmin(kdepeg(p))c_{\text{efficiency}}(p) = \frac{x_{\text{base}}}{x_{\text{base}} - x_{\text{min}}(k_{\text{depeg}}(p))}

log Capital Efficiency Ratio vs. Depeg Price for n=5

For example, in the 5-asset case, a depeg limit of $0.90 corresponds to around a 15x capital efficiency increase, while a limit of $0.99 corresponds to around a 150x capital efficiency increase.

You can view the interactive graph on Desmos here.

Tick Consolidation

Overview

A full Orbital AMM consists of multiple Orbital ticks with different

kk
values.

In this section, we discuss situations in which multiple ticks can be treated as one for the purposes of trade calculations. This will set us up to construct a global trade invariant for the overall orbital AMM in the next section.

As a reminder, for the sake of simplicity we will assume each tick has only a single LP.

Consolidation Math

Imagine we have 2 ticks,

TaT_a
and
TbT_b
with reserves
xa\vec{x}_a
and
xb\vec{x}_b
and parameters
(ra,ka)(r_a, k_a)
and
(rb,kb)(r_{b}, k_{b})
respectively.

Case 1: Both Reserves Interior

The simplest case is that both reserves vectors begin and end the trade "interior" to their respective ticks, which is to say, not on the tick boundary -- i.e.

xav<kaandxbv<kb\vec{x}_a \cdot \vec{v} < k_a \quad \text{and} \quad \vec{x}_b \cdot \vec{v} < k_b

In this case, both ticks behave locally like normal spherical AMMs, and it must be that

raxa\vec{r}_a - \vec{x}_a
is parallel to
rbxb\vec{r}_b - \vec{x}_b
, since otherwise at least one of the
xix_i
would have a different price relative to some
xjx_j
on the two AMMs, allowing for an arbitrage.

Since by definition

ra=ranv\vec{r}_a = r_a \sqrt{n} \vec{v}
and
rb=rbnv\vec{r}_b = r_b \sqrt{n} \vec{v}
, we can see that
raxa\vec{r}_a - \vec{x}_a
is parallel to
rbxb\vec{r}_b - \vec{x}_b
if and only if

xa=rarbxb\vec{x}_a = \frac{r_a}{r_b} \vec{x}_b

This means the combined reserves of the two AMMs are equal to

xa+xb=(1+rarb)xb=(ra+rb)xbxb\vec{x}_a + \vec{x}_b = \left(1 + \frac{r_a}{r_b}\right) \vec{x}_b = (r_a + r_b) \frac{\vec{x}_b}{\|\vec{x}_b\|}

Since our AMM constant is

x=r\|\vec{x}\| = r
, we can see that reserves scale with the AMM's radius, and so locally we can treat the two ticks as a single spherical AMM with

rc=ra+rbr_c = r_a + r_b

As soon as one of the reserve vectors hits the boundary of its tick, we can no longer treat the two ticks as a single spherical AMM, and must move on to one of the later cases.

Case 2: Both Reserves on Boundary

Let's say that both ticks start with reserves that are on their boundaries as defined by their plane constants.

Now imagine that they execute a trade

Δ\vec{\Delta}
such that their reserves move from
x\vec{x}
to
x=x+Δ\vec{x}' = \vec{x} + \vec{\Delta}
after which they are still on their boundaries.

In this case for tick

AA
we have

xav=kaandxav=(xa+Δa)v=ka+Δav=kaΔav=0\vec{x}_a \cdot \vec{v} = k_a \quad \text{and} \quad \vec{x}'_a \cdot \vec{v} = (\vec{x}_a + \vec{\Delta}_a) \cdot \vec{v} = k_a + \vec{\Delta}_a \cdot \vec{v} = k_a \Rightarrow \vec{\Delta}_a \cdot \vec{v} = 0

This means the trade vector

Δa\vec{\Delta}_a
must be orthogonal to
v\vec{v}
if tick reserves both start and end on the boundary, and the same must be true for
Δb\vec{\Delta}_b
. In other words, this trade is entirely within the subspace orthogonal to
v\vec{v}
.

As we discussed in the section on tick boundary geometry, ticks on their boundaries behave like spherical AMMs in the subspace orthogonal to

v\vec{v}
. Because both AMMs have centers parallel to
v\vec{v}
, which is orthogonal to every vector in that subspace, we can treat this subspace AMM as having a center of
00
, and by similar logic to case 1 it has a radius of

sc=sa+sbs_c = s_a + s_b

where from the section on tick boundary geometry we have e.g.

sa=ra2(karan)2s_a = \sqrt{r_a^2 - (k_a - r_a\sqrt{n})^2}

Global Trade Invariant

This section describes how we can locally compute trades using all of our ticks simultaneously. It is extremely dense. Your favorite LLM may be of some assistance if you are wanting to parse it.

Setup

First, note that the tick consolidation section above shows we can consolidate all currently interior ticks into a single spherical tick in

Rn\mathbb{R}^n
, and all currently boundary ticks into another spherical tick in the subspace of
Rn\mathbb{R}^n
orthogonal to
v\vec{v}
. So, for the rest of this section, we will assume we have precisely two ticks, one interior and one boundary.

We call the total reserve vector of our combined Orbital AMM

xtotal\vec{x}_{\text{total}}
. As described in the section on polar reserve decomposition, we can break this down into components parallel and orthogonal to
v=1n(1,1,,1)\vec{v} = \frac{1}{\sqrt{n}} (1, 1, \dots, 1)
, so

xtotal=αtotalv+wtotal\vec{x}_{\text{total}} = \alpha_{\text{total}} \vec{v} + \vec{w}_{\text{total}}

for some

wtotalv\vec{w}_{\text{total}} \perp \vec{v}
.

We do the same for our consolidated and boundary ticks:

xint=αintv+wint\vec{x}_{\text{int}} = \alpha_{\text{int}} \vec{v} + \vec{w}_{\text{int}}

xbound=αboundv+wbound\vec{x}_{\text{bound}} = \alpha_{\text{bound}} \vec{v} + \vec{w}_{\text{bound}}

and because

xtotal=xint+xboundx_{\text{total}} = x_{\text{int}} + x_{\text{bound}}
, we must have

αtotal=αint+αbound\alpha_{\text{total}} = \alpha_{\text{int}} + \alpha_{\text{bound}}

wtotal=wint+wbound\vec{w}_{\text{total}} = \vec{w}_{\text{int}} + \vec{w}_{\text{bound}}

Finding alpha_bound and alpha_int

We know that the boundary reserves

xbound\vec{x}_{\text{bound}}
must satisfy

xboundv=kbound\vec{x}_{\text{bound}} \cdot \vec{v} = k_{\text{bound}}

by definition, since a boundary AMM always has its reserves on the boundary as defined by its plane constraint.

By the polar reserve decomposition, we also have

xboundv=(αboundv+wbound)v=αbound\vec{x}_{\text{bound}} \cdot \vec{v} = (\alpha_{\text{bound}} \vec{v} + \vec{w}_{\text{bound}}) \cdot \vec{v} = \alpha_{\text{bound}}

so that

αbound=kbound\alpha_{\text{bound}} = k_{\text{bound}}

Since

αtotal=αint+αbound\alpha_{\text{total}} = \alpha_{\text{int}} + \alpha_{\text{bound}}

we then have that

αint=αtotalαbound=xtotalvkbound\alpha_{\text{int}} = \alpha_{\text{total}} - \alpha_{\text{bound}} = \vec{x}_{\text{total}} \cdot \vec{v} - k_{\text{bound}}

Showing w_int and w_bound are parallel

Construct an orthonormal basis

z1,,zn1\vec{z}_1, \ldots, \vec{z}_{n-1}
for the subspace orthogonal to
v\vec{v}
. Together with
v\vec{v}
, this constitutes an orthonormal basis for our entire reserve space, where each basis element represents some basket of the constitutent stablecoins in different proportions.

Since this is just a rotation of the axes, our interior tick is still a spherical AMM between all of these new basis vectors, and our boundary tick, being a spherical AMM in the subspace orthogonal to

v\vec{v}
, is a spherical AMM between all the basis vectors of that subspace,
z1,,zn1\vec{z}_1, \ldots, \vec{z}_{n-1}
.

From this, we can see that the interior tick and boundary tick must hold the

zi\vec{z}_i
in equal proportions, since otherwise there would be some
ii
and
jj
for which the price of the bundle
zi\vec{z}_i
was different to the price of the bundle
zj\vec{z}_j
on the boundary and interior ticks, which would present an arbitrage opportunity.

Since the

zi\vec{z}_i
form a complete basis for the subspace of reserve space orthogonal to
v\vec{v}
,
this implies that
wint\vec{w}_{\text{int}}
must in fact be parallel to
wbound\vec{w}_{\text{bound}}
.

Finding ||w_int||

Recall from the section on tick boundary geometry that

wbound2=sbound2=rbound2(kboundrboundn)2\|\vec{w}_{\text{bound}}\|^2 = s_{\text{bound}}^2 = r_{\text{bound}}^2 - (k_{\text{bound}} - r_{\text{bound}} \sqrt{n})^2

Since, as we showed in the previous subsection,

wint\vec{w}_{\text{int}}
is parallel to
wbound\vec{w}_{\text{bound}}
, the length of their sum is simply the sum of their lengths, so

wtotal=wint+wbound\|\vec{w}_{\text{total}}\| = \|\vec{w}_{\text{int}}\| + \|\vec{w}_{\text{bound}}\|

Substituting in, we then obtain

wint=wtotalwbound=xtotal(xtotalv)vrbound2(kboundrboundn)2\|\vec{w}_{\text{int}}\| = \|\vec{w}_{\text{total}}\| - \|\vec{w}_{\text{bound}}\| = \|\vec{x}_{\text{total}} - (\vec{x}_{\text{total}} \cdot \vec{v}) \vec{v}\| - \sqrt{r_{\text{bound}}^2 - (k_{\text{bound}} - r_{\text{bound}} \sqrt{n})^2}

The Full Invariant

Our interior tick's sphere invariant is

rint2=rintxint2r_{\text{int}}^2 = \|\vec{r}_{\text{int}} - \vec{x}_{\text{int}}\|^2

by the Pythagorean theorem, this implies

rint2=rintαintv2+wint2=(αintrintn)2v2+wint2r_{\text{int}}^2 = \|\vec{r}_{\text{int}} - \alpha_{\text{int}} \vec{v}\|^2 + \|\vec{w}_{\text{int}}\|^2 = (\alpha_{\text{int}} - r_{\text{int}} \sqrt{n})^2 \|\vec{v}\|^2 + \|\vec{w}_{\text{int}}\|^2

Substituting in our results from the previous sections and simplifying, we then obtain our full invariant

rint2=((xtotalvkbound)rintn)2+(xtotal(xtotalv)vrbound2(kboundrboundn)2)2r_{\text{int}}^2 = \left((\vec{x}_{\text{total}} \cdot \vec{v} - k_{\text{bound}}) - r_{\text{int}} \sqrt{n}\right)^2 + \left(\|\vec{x}_{\text{total}} - (\vec{x}_{\text{total}} \cdot \vec{v}) \vec{v}\| - \sqrt{r_{\text{bound}}^2 - (k_{\text{bound}} - r_{\text{bound}} \sqrt{n})^2}\right)^2

Note this is equivalent to the formula for a generalized torus, a higher-dimensional extension of the familiar donut shape. Intuitively, this is because we are "adding together" the liquidity from the interior tick, a full sphere, with the liquidity from the boundary tick, a lower-dimensional sphere in a subspace, just the same way as a donut is construced by centering a sphere over every point on a circle.

Computation

We can directly compute this invariant as

rint2=(1ni=1nxintikboundrintn)2+(i=1nxtotali21n(i=1nxtotali)2rbound2(kboundrboundn)2)2r_{\text{int}}^2 = \left( \frac{1}{\sqrt{n}} \sum_{i=1}^n x_{\text{int}i} - k_{\text{bound}} - r_{\text{int}} \sqrt{n} \right)^2 + \left( \sqrt{ \sum_{i=1}^n x_{\text{total}i}^2 - \frac{1}{n} \left( \sum_{i=1}^n x_{\text{total}i} \right)^2 } - \sqrt{ r_{\text{bound}}^2 - (k_{\text{bound}} - r_{\text{bound}} \sqrt{n})^2 } \right)^2

Implementations of orbital should keep track of the sums of reserves and squared reserves that appear in that expression.

Since trades of one token for another affect only two of terms in those sums, we can compute the invariant for trades in constant time regardless of the number of dimensions

nn
.

Trading Within Tick Boundaries

Logic

Now that we have the global trade invariant, it is straightforward to compute trades.

Let's say a user provides

dd
units of asset
ii
to the AMM and wants to exchange it for as much of asset
jj
as they can get.

Starting from some valid reserve state

xtotal\vec{x}_{\text{total}}
, we simply update the value of
xix_i
to
xi+dx_i + d
and then solve for the
xjx_j
that satisfies the global invariant while leaving all other asset balances the same. If there are multiple solutions, we choose the one that leaves the ending balances of
xjx_j
below the centers of both the interior and boundary ticks.

This is a quartic equation in

xjx_j
, which we can solve easily onchain using Newton's method. As mentioned above, if we explicitly track sums in the AMM, the complexity of the equation remains constant time regardless of the number of dimensions in the AMM.

Crossing Ticks

The global trade invariant we derived in the previous section assumes that ticks maintain their status as either "interior" or "boundary."

However, during trades, the system's state can change in a way that causes a previously interior tick's reserves to become pinned at its boundary (or vice versa). In that case, we need to remove the tick from the consolidated boundary (interior) tick, and add it to the consolidated interior (boundary) tick, and then update the torus formula accordingly.

In this section, we'll explain how to detect when these crossings happen and how to handle them by breaking the trades that cause them into segments.

Intuition

Imagine we have several ticks of different sizes, each one a sphere intersected by a plane determined by that tick's plane constant. These spheres might be different sizes depending on their respective radii, but we could imagine "zooming in" or "zooming out" on the spheres so that they all appeared to be the same size, perhaps represented by a radius of 1.

If we were to do this, we would see something interesting: all of the ticks that are currently "interior," i.e. all the ticks whose reserves are not precisely on their plane boundary, would appear to have their reserves at exactly the same point on the sphere. Geometrically, we can say this is because the spheres are similar. In terms of trading, we can say, as above, that this is because otherwise there would be an arbitrage opportunity between the ticks.

Furthermore, ticks have their reserves trapped on their plane boundary and become boundary ticks precisely when this common reserve point strays farther from the equal price point than that tick's plane boundary.

So, in order to trade across ticks, we just compute the trade assuming no ticks have moved from interior to boundary as described in the section on within-tick trades. Then we check the new common interior reserve point and see if it has crossed over the plane boundary of either the closest interior tick or the closest boundary tick. If it has, we compute the trade exactly up to that boundary point, update the type of the tick that was crossed, and compute the rest of the trade.

Normalization

We use normalized quantities to compare ticks of different sizes by dividing through by the tick radius.

The normalized position is

xnorm=x/rx^{\text{norm}} = \vec{x} / r

The normalized projection is

αnorm=xnormv=xvr\alpha^{\text{norm}} = \vec{x}^{\text{norm}} \cdot \vec{v} = \frac{\vec{x} \cdot \vec{v}}{r}

The normalized boundary is

knorm=krk^{\text{norm}} = \frac{k}{r}

Note that if

αnorm=knorm\alpha^{\text{norm}} = k^{\text{norm}}
for a given tick, we can multiply both sides by
rr
to remove the normalization and see that the tick is at its boundary.

Suppose that for a given tick we have

αnorm<knorm\alpha^{\text{norm}} < k^{\text{norm}}
, so that it is an interior tick. By no-arbitrage, its reserve vector
x\vec{x}
will be parallel to the reserve vectors of all other interior ticks, and so its normalized reserve vector
xnorm\vec{x}^{\text{norm}}
will be precisely equal to the normalized reserve vector of all interior ticks, which we will call
xintnorm\vec{x}^{\text{norm}}_{\text{int}}
.

This interior normalized reserve vector has a projection

αintnorm=xintnormv\alpha^{\text{norm}}_{\text{int}} = \vec{x}^{\text{norm}}_{\text{int}} \cdot \vec{v}

A given tick

ii
is interior if and only if
kinorm>αintnormk^{\text{norm}}_i > \alpha^{\text{norm}}_{\text{int}}
. To see why, first assume
ii
is interior. Then by definition
kinorm>αinorm=αintnormk^{\text{norm}}_i > \alpha^{\text{norm}}_i = \alpha^{\text{norm}}_{\text{int}}
. For the other direction, assume
kinorm>αintnormk^{\text{norm}}_i > \alpha^{\text{norm}}_{\text{int}}
. Then if this tick were to have the same normalized position as an interior tick, it would not hit its plane constraint, implying that by no-arbitrage it must in fact have this normalized position, making it an interior tick.

Trade Segmentation Process

At any given time, the AMM's location in tick space is demarcated by

kintmink_{\text{int}}^{\text{min}}
, the minimum normalized
kk
of a currently interior tick, which will be the next tick to become trapped at its boundary if the overall reserves continue to move away from the equal price point. Similarly,
kboundmaxk_{\text{bound}}^{\text{max}}
is the maximum normalized
kk
of a currently boundary tick, which will be the first tick to become interior again as AMM reserves return to the equal price point.

Let's say we are trying to compute a trade

Δtotal\vec{\Delta}_{\text{total}}
where the user putting in some quantity
ditotald_i^{\text{total}}
of asset
XiX_i
to remove some of asset
XjX_j
. The steps to segment the trade are as follows:

Calculate Assuming No Tick Boundary Crossing: Assume all currently interior ticks stay interior and all currently boundary ticks stay boundary and compute the potential final AMM state

xpotential\vec{x}_{\text{potential}}
and the corresponding interior tick normalized projection
αintnorm\alpha_{\text{int}}^{\text{norm}}
using the global trade invariant method above.

Boundary Crossing Check: If our assumptions were correct and no ticks changed from interior to boundary or vice versa, then we will have

kboundmaxαintnormkintmink_{\text{bound}}^{\text{max}} \leq \alpha_{\text{int}}^{\text{norm}} \leq k_{\text{int}}^{\text{min}}
-- i.e. our new interior tick point separates all the interior tick boundaries from all the boundary tick boundaries.

If that's the case, we're done. Otherwise, we need to segment the trade.

Segmentation (If Crossing Detected)

We know the normalized boundary being crossed from the prior step, which we'll call

kcrossnormk_{\text{cross}}^{\text{norm}}
. This crossover is going to occur when
αintnorm=kcrossnormαint=rintkcrossnorm\alpha_{\text{int}}^{\text{norm}} = k_{\text{cross}}^{\text{norm}} \Rightarrow \alpha_{\text{int}} = r_{\text{int}} k_{\text{cross}}^{\text{norm}}
.

So then at the crossover point, we have

αcrossover=xv=xintv+xboundv=αint+kboundtotal=rintkcrossovernorm+xboundtotal\alpha_{\text{crossover}} = \vec{x} \cdot \vec{v} = \vec{x}_{\text{int}} \cdot \vec{v} + \vec{x}_{\text{bound}} \cdot \vec{v} = \alpha_{\text{int}} + k_{\text{bound}}^{\text{total}} = r_{\text{int}} k_{\text{crossover}}^{\text{norm}} + x_{\text{bound}}^{\text{total}}

where

kboundtotalk_{\text{bound}}^{\text{total}}
is the sum of the
kk
values of all currently boundary ticks.

Find Intersection Trade

Δcrossover\vec{\Delta}_{\text{crossover}}

We want to find the trade

Δcrossover=(0,,dicrossover,0,,djcrossover,0,)\vec{\Delta}_{\text{crossover}} = (0, \ldots, d_i^{\text{crossover}}, 0, \ldots, -d_j^{\text{crossover}}, 0, \ldots)

between

ii
and
jj
that respects the global invariant while taking us precisely to the crossover point
xcrossover=x+Δcrossover\vec{x}_{\text{crossover}} = \vec{x} + \vec{\Delta}_{\text{crossover}}
where we have

αcrossover=xcrossoverv=(x+Δcrossover)v=αtotal+Δcrossoverv=αtotal+1n(dicrossoverdjcrossover)\alpha_{\text{crossover}} = \vec{x}_{\text{crossover}} \cdot \vec{v} = (\vec{x} + \vec{\Delta}_{\text{crossover}}) \cdot \vec{v} = \alpha_{\text{total}} + \vec{\Delta}_{\text{crossover}} \cdot \vec{v} \\ = \alpha_{\text{total}} + \frac{1}{\sqrt{n}}(d_i^{\text{crossover}} - d_j^{\text{crossover}})

so that we see

djcrossover=n(αtotalαcrossover)+dicrossoverd_j^\text{crossover} = \sqrt{n} (\alpha_\text{total} - \alpha_\text{crossover}) + d_i^\text{crossover}

Substituting that in to the global invariant formula from above yields a quadratic equation in

dicrossoverd_i^{\text{crossover}}
which we can simply solve using the quadratic formula.

Once we find the crossover point, we can execute the trade up to there, adjust the crossed tick from interior to boundary or vice versa, and proceed with the rest of the trade, re-segmenting if necessary.

Conclusion

Today, Orbital is just a design, but we're excited to see how it might change the stablecoin liquidity landscape.

If you're interested in exploring with us, we'd love to hear from you.

Written by

Biography

Dave White is a Research Partner at Paradigm. Previously, Dave was a quantitative trader and researcher at firms including Headlands, Two Sigma, and Cutler Group. He is three credits shy of an A.B. in Mathematics from Harvard University.

Biography

Dan Robinson is a General Partner at Paradigm, focused on crypto investments and research into open-source protocols. Previously, Dan was a protocol researcher at Interstellar. Before Interstellar, Dan practiced as a litigation attorney at Paul, Weiss, Rifkind, Wharton & Garrison LLP. He earned a J.D. from Harvard Law School and an A.B. from Harvard University.

Biography

Ciamac Moallemi is William von Mueffling Professor of Business in the Decision, Risk, & Operations Division of the Graduate School of Business at Columbia University, and the Director of the Briger Family Digital Finance Lab. In his work with Paradigm, he focuses on applied research in mechanism and market design, with a particular focus on decentralized finance.

Disclaimer: This post is for general information purposes only. It does not constitute investment advice or a recommendation or solicitation to buy or sell any investment and should not be used in the evaluation of the merits of making any investment decision. It should not be relied upon for accounting, legal or tax advice or investment recommendations. This post reflects the current opinions of the authors and is not made on behalf of Paradigm or its affiliates and does not necessarily reflect the opinions of Paradigm, its affiliates or individuals associated with Paradigm. The opinions reflected herein are subject to change without being updated.

Copyright © 2025 Paradigm Operations LP All rights reserved. “Paradigm” is a trademark, and the triangular mobius symbol is a registered trademark of Paradigm Operations LP