# Superellipse pools (PR #3211)

Subnet pools move from the balancer curve to a bounded ellipse. Price is unchanged at the switch; balances no swap can reach move to a per-subnet lending vault.

_Source: https://taostats.io/docs/concepts/protocol-changes/superellipse-pools_

_Last reviewed: 2026-10-07_

> [!WARNING]
> **Not live on mainnet yet**
>
> This page describes [subtensor PR #3211](https://github.com/RaoFoundation/subtensor/pull/3211) (open, commit `7f634b4`). Finney runs spec 473. Loans from the lending vault are covered in [Shorts and longs](https://taostats.io/docs/concepts/protocol-changes/shorts-and-longs).

## What changes

Every subnet pool gets a new pricing rule. At the switch:

- the price is the same;
- small swaps move the price by the same amount as today;
- big swaps move the price more than they do today;
- there is a hard top and bottom price that no swap can pass.

The balancer curve runs forever in both directions. The new curve is a section of an ellipse and stops at two fixed points. Superellipses are a family of curves; the chain fixes `n = 2`, so the curve is a plain ellipse.

Because the curve stops, part of each pool can never be paid out by any swap. That part moves out of the pool into a **lending vault**. No new TAO or alpha is created.

| Name | What it is |
|---|---|
| Trading pool | The pool swaps trade against. Today's pool, with less in it. |
| Lending vault | A separate account per subnet. It holds the balances swaps can't reach and lends them out. |
| Shorts / longs | Loans from the vault. A short borrows alpha against TAO; a long borrows TAO against alpha. |

![Pool balances: the balancer curve today vs the bounded ellipse](https://taostats.io/images/docs/concepts/superellipse-pool-curves.png)

The chart is drawn at 50:50 weights. Every subnet runs at 50:50 (128 subnets checked on chain, 2026-10-07).

## How the curve is set

Each pool stores four numbers: an alpha scale, a TAO scale, and a centre point (one alpha value, one TAO value). The pool balances always sit on an ellipse around that centre, and the centre sits beyond the balances.

| Number | Set from | At 50:50 |
|---|---|---|
| Alpha scale | Pool alpha × 2 × weight | Equals pool alpha |
| TAO scale | Pool TAO × 2 × (1 − weight) | Equals pool TAO |
| Centre (alpha) | Pool alpha + alpha scale | 2 × pool alpha |
| Centre (TAO) | Pool TAO + TAO scale | 2 × pool TAO |

- **Fixed at the switch.** Swaps don't change the four numbers. There is no call to tune pool depth.
- **Same shape everywhere.** The scales come from the current weight, and every weight is 50:50.
- **Emission shifts the centre.** Emission adds TAO and alpha to the pool and moves the centre by the same amounts. Price, small-swap moves and the price limits stay as they were: emission does not make the pool deeper.

### Price limits

| End | Price | Reached when |
|---|---|---|
| Top (buying) | Infinite | Pool alpha falls to about 59% of its level at the switch |
| Bottom (selling) | Zero | Pool TAO falls to about 59% of its level at the switch |

A swap must finish strictly inside these ends. A swap that would reach an end fails.

### The switch

- At the switch, the balances outside the curve's reach move to that subnet's vault. Vault funding happens once: a subnet that already has a vault is skipped, so later emission stays in the trading pool, beyond the reach of swaps.
- Up to 256 vaults. All 128 current subnets fit.
- Root and empty pools are left out.
- Lending turns on only after every pool has switched.

## Balancer vs ellipse

| | Balancer (today) | Ellipse |
|---|---|---|
| Price at the switch | — | Same |
| Small swaps | — | Same move |
| Big swaps | Price moves less | Price moves more |
| Buying | Never runs out; price rises forever | Price infinite at a fixed point |
| Selling | Price nears 0, never reaches it | Price is 0 at a fixed point |
| Most alpha one buy can take | Approaches 100% | 41.4% of the pool at the switch |
| Most TAO one sell can take | Approaches 100% | 41.4% of the pool at the switch |
| Balances swaps can't reach | None | About 59% of each side, held in the vault |
| Emission | Lands in the pool and can be swapped | Shifts the centre; the added depth can't be swapped |

## Worked numbers

At 50:50, from the pool at the switch, swap fees left out.

**Buying alpha with TAO**

| TAO in (% of pool TAO) | Balancer: alpha out | Balancer: price | Ellipse: alpha out | Ellipse: price |
|---|---|---|---|---|
| 1% | 0.99% | ×1.02 | 0.99% | ×1.02 |
| 10% | 9.1% | ×1.21 | 9.1% | ×1.21 |
| 25% | 20.0% | ×1.56 | 19.9% | ×1.60 |
| 50% | 33.3% | ×2.25 | 32.3% | ×2.65 |
| 75% | 42.9% | ×3.06 | 39.2% | ×5.57 |
| 90% | 47.4% | ×3.61 | 41.1% | ×14.1 |
| 100% | 50.0% | ×4.00 | Not possible | Infinite |

**Selling alpha for TAO**

| Alpha in (% of pool alpha) | Balancer: TAO out | Balancer: price | Ellipse: TAO out | Ellipse: price |
|---|---|---|---|---|
| 1% | 0.99% | ×0.98 | 0.99% | ×0.98 |
| 10% | 9.1% | ×0.83 | 9.1% | ×0.83 |
| 25% | 20.0% | ×0.64 | 19.9% | ×0.63 |
| 50% | 33.3% | ×0.44 | 32.3% | ×0.38 |
| 75% | 42.9% | ×0.33 | 39.2% | ×0.18 |
| 90% | 47.4% | ×0.28 | 41.1% | ×0.07 |
| 100% | 50.0% | ×0.25 | Not possible | 0 |

Up to about 10% of the pool the two curves agree. Past 25% the ellipse moves the price more, and much more near the ends.

## The lending vault

The vault holds the unreachable balances: TAO as a balance, alpha as stake. Borrowers draw from the vault, never the trading pool. Total borrowing in each asset is capped at 10% of the vault. See [Shorts and longs](https://taostats.io/docs/concepts/protocol-changes/shorts-and-longs).

## When a subnet is deregistered

This applies only when a subnet is removed from the network.

1. New loans and interest stop at the removal block.
2. Shorts settle against their locked TAO and sale proceeds, at the higher of spot and the 24-hour average. The debt returns to the vault; any surplus goes to the owner; any shortfall is booked as a loss.
3. Everything in the vault that isn't lent out moves back into the trading pool, TAO and alpha.
4. Alpha holders are paid from the trading pool's TAO, as today.
5. Longs settle last, from what their alpha was paid. A long owing 50 τ against a 70 τ payout repays 50 τ and gets 20 τ back. With a 20 τ payout, the chain takes 20 τ and books a 30 τ loss. Nothing is taken from the borrower's other funds.
6. The netuid can't be reused until every loan record is cleared.

So the roughly 59% held in the vault is paid out to alpha holders at removal, less anything still lent out. TAO recovered from longs is kept apart from the holders' payout, so it isn't counted twice.

## What it means for Taostats data

| Area | Change |
|---|---|
| Pool depth | At the switch, pool TAO and pool alpha drop by about 59% while price stays the same. The moved balances sit in vault accounts. |
| Alpha in / out | Alpha moved to the vault becomes stake, so alpha out rises by the amount alpha in falls. |
| Total stake | TAO moved to the vault leaves total stake. |
| Price-impact quotes | The balancer formula matches up to about 10% of the pool. Past that it understates the move and allows swaps the chain rejects. |
| Swap limits | The most alpha a buy can take and the most TAO a sell can take, fixed until the pool moves. |
| Emission | Shown reserves grow with emission, but the extra can't be swapped, so reserves overstate real depth more over time. |

Storage names and affected API fields are not yet confirmed on chain; they are checked once the PR reaches a testnet.

Source: [Superellipse pools (Rufus)](https://s3.hippius.com/rufus/public/superellipse-pools.html) · [PR #3211](https://github.com/RaoFoundation/subtensor/pull/3211)
