Orbital

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 -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 dimensions, they behave like -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

where is AMM's reserve of asset .

To see that the minimum reserve of any asset is $0$, note that the sphere is centered at , and the farthest a point on the sphere can be from the center in any dimension is the radius .

As long as asset prices are positive, no-arbitrage implies we should never have reserves for any , since if for some , then

and some trader could remove of asset 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 to the AMM, but can assume that for all in normal circumstances.

Token Prices on the Sphere

Let's say a trader wants to give the AMM some token and take out some token while staying on the surface

In this case, we must have

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

Intuitively we can verify that if the AMM has high reserves of and low reserves of , this fraction will be small, meaning you don't get much per unit of , 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

By our sphere constraint, we have

So then

so

and we have

Since they're all multiples of , 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

In terms of trading, we can think of as a portfolio of 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 on the surface of the AMM, linear algebra tells us we can decompose it into a vector parallel to and a vector orthogonal to , the vector from the origin to the equal price point.

In other words, for any reserve state , we have

Note that because is a unit vector, we can calculate directly as , which mechanically equals times the sum of all reserves in .

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

Since by definition, we can use the Pythagorean theorem to simplify this to

or, rearranging,

From this, we can see that if we hold the component of reserves parallel to constant, our AMM acts as a lower-dimensional spherical AMM in the subspace orthogonal to with radius

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 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 in has the form

This is another way of saying that the plane consists precisely of all points whose projection on is -- i.e. the points of the form for some , which you get by starting from and adding some vector orthogonal to .

From the polar reserve decomposition section above, we can see that when reserves lie on this boundary, since the component of reserves parallel to is constant at , the tick AMM functions as a spherical AMM in the -dimensional subspace orthogonal to with radius and center .

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 where

for all .

In that case , and since , we can define this tick using the plane constant

The Maximal Tick

The maximal tick's boundary is defined by the plane that lets us achieve the highest possible value of that doesn't require any reserve to go above . This happens when one reserve reaches its minimum value of 0 while all other reserves are at the maximum, .

For example, consider and .

It's still on the sphere because

and we have

To see that this is indeed the maximal tick boundary, note that the reserves of all tokens but are already at their maximum of assuming positive prices. So, the only way we might be able to increase further would be to increase the reserves of while decreasing the other reserves by a lesser amount so that we don't violate the AMM constant.

But note that the gradient of is

at this point. So if the AMM reduces its reserves infinitesimally, because of the 0 gradient we won't decrease the value of the AMM constant at all. That means so we can't increase 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

Let's derive the minimum possible reserves of any one of the coins, which we'll denote as . By symmetry, the reserves of all the other must be equal to one another at that point.

Our sphere constraint then becomes

and our plane invariant becomes

so that

Solving the resulting quadratic equation for we get

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 to fall below .

This means the liquidity provider creating the tick can act as if they have "virtual reserves" of of each of the stablecoins the tick trades and don't actually need to provide those 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 , we can then define

and

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 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 is small enough that the plane constaint is binding, the depegged coin will have reserves of

and

Recall from the section on pricing that the instantaneous price of token with respect to token is

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

We can then invert this to obtain, for a given , the such that the boundary kicks in exactly at that depeg price:

Note that for large-enough , such as , 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 , the LP of a given tick gets to take advantage of virtual reserves

for each of the assets. If we assume they create the AMM when reserves are at the equal price point , the reserves they would need to provide for each coin in the spherical AMM would be

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

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 :

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

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 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, and with reserves and and parameters and respectively.

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.

In this case, both ticks behave locally like normal spherical AMMs, and it must be that is parallel to , since otherwise at least one of the would have a different price relative to some on the two AMMs, allowing for an arbitrage.

Since by definition and , we can see that is parallel to if and only if

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

Since our AMM constant is , 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

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.

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 such that their reserves move from to after which they are still on their boundaries.

In this case for tick we have

This means the trade vector must be orthogonal to if tick reserves both start and end on the boundary, and the same must be true for . In other words, this trade is entirely within the subspace orthogonal to .

As we discussed in the section on tick boundary geometry, ticks on their boundaries behave like spherical AMMs in the subspace orthogonal to . Because both AMMs have centers parallel to , which is orthogonal to every vector in that subspace, we can treat this subspace AMM as having a center of $0$, and by similar logic to case 1 it has a radius of

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

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 , and all currently boundary ticks into another spherical tick in the subspace of orthogonal to . 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 . As described in the section on polar reserve decomposition, we can break this down into components parallel and orthogonal to , so

for some orthogonal to .

We do the same for our consolidated and boundary ticks:

and because , we must have

Finding alpha_bound and alpha_int

We know that the boundary reserves must satisfy

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

so that

Since

we then have that

Showing w_int and w_bound are parallel

Construct an orthonormal basis for the subspace orthogonal to . Together with , 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 , is a spherical AMM between all the basis vectors of that subspace, .

From this, we can see that the interior tick and boundary tick must hold the in equal proportions, since otherwise there would be some and for which the price of the bundle was different to the price of the bundle on the boundary and interior ticks, which would present an arbitrage opportunity.

Since the form a complete basis for the subspace of reserve space orthogonal to , this implies that must in fact be parallel to .

Finding ||w_int||

Recall from the section on tick boundary geometry that

Since, as we showed in the previous subsection, is parallel to , the length of their sum is simply the sum of their lengths, so

Substituting in, we then obtain

The Full Invariant

Our interior tick's sphere invariant is

by the Pythagorean theorem, this implies

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

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

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 .

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 units of asset to the AMM and wants to exchange it for as much of asset as they can get.

Starting from some valid reserve state , we simply update the value of to and then solve for the 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 below the centers of both the interior and boundary ticks.

This is a quartic equation in , 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

The normalized projection is

The normalized boundary is

Note that if for a given tick, we can multiply both sides by to remove the normalization and see that the tick is at its boundary.

Suppose that for a given tick we have , so that it is an interior tick. By no-arbitrage, its reserve vector will be parallel to the reserve vectors of all other interior ticks, and so its normalized reserve vector will be precisely equal to the normalized reserve vector of all interior ticks, which we will call .

This interior normalized reserve vector has a projection

A given tick is interior if and only if . To see why, first assume is interior. Then by definition . For the other direction, assume . 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 , the minimum normalized 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, is the maximum normalized 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 where the user putting in some quantity of asset to remove some of asset . 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 and the corresponding interior tick normalized projection 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 -- 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 . This crossover is going to occur when .

So then at the crossover point, we have

where is the sum of the values of all currently boundary ticks.

Find Intersection Trade

We want to find the trade

between and that respects the global invariant while taking us precisely to the crossover point where we have

so that we see

Substituting that in to the global invariant formula from above yields a quadratic equation in 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.

Acknowledgements

Joey Santoro, Jordi Alexander, Will Price, Alan Niemerg, Mahmoud Lababidi

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.

en