Alpha Token Conversion

Staking

Conversion between TAO and subnet-specific Alpha tokens via concentrated liquidity AMM in the Swap pallet.

Click items to navigate to their reference pages.

The Big Picture

Alpha conversion is the concentrated liquidity AMM at the heart of each subnet's economy. It uses the Swap pallet's Uniswap V3-style concentrated liquidity pools, where liquidity is distributed across discrete tick ranges rather than uniformly. When demand for a subnet's stake increases, its Alpha price rises — rewarding early stakers and signaling subnet value.

Why This Matters

The Alpha exchange rate is the "price" of subnet stake. It determines how much Alpha you get when staking (and how much TAO when unstaking). Understanding price impact and slippage is crucial for large stake operations.

Example Scenario

A subnet pool has concentrated liquidity across tick ranges. The current price is at tick 2000 (~1.2214 TAO/Alpha). Staking 1,000 TAO: the swap routes through active ticks, consuming liquidity at each price level. If enough liquidity exists near the current tick, slippage is minimal. If the swap crosses into higher ticks with less liquidity, more TAO is needed per Alpha — that price impact is non-linear, unlike a simple constant-product AMM. Check the pool's active liquidity to estimate output.

Common Questions

Why does price change when I stake?
With concentrated liquidity, swaps move the price through discrete tick ranges. The active liquidity at each tick determines price impact — larger swaps may cross multiple ticks, each with different liquidity depth, causing non-linear slippage.
What happens to emissions in the pool?
Emission TAO is injected into the pool, increasing Alpha price for all stakers. This is how stakers earn — their Alpha becomes worth more TAO over time.

Use Cases

  • Estimating stake conversion rates
  • Calculating price impact for large stakes
  • Comparing subnet Alpha prices
  • Understanding AMM mechanics for dTAO

Since dTAO, TAO-to-Alpha conversion routes through the Swap pallet's concentrated liquidity AMM (Uniswap V3-style), not a simple constant-product pool. Each subnet has a TAO/Alpha pool with liquidity concentrated across discrete tick ranges.

The swap_tao_for_alpha function delegates to the Swap pallet's swap interface, which routes through active liquidity ticks to determine the output amount. This means the exchange rate adjusts dynamically based on available liquidity at each price level within the subnet's pool.

Triggers

  • Stake add/remove operations
  • Emission distribution at epoch boundaries

Inputs (2)

ItemTypeRole
SubnetAlphaIn SubtensorModulestorageCurrent Alpha supply per subnet
SubnetTAO SubtensorModulestorageTAO reserve in each subnet pool

Outputs (3)

ItemTypeRole
Alpha SubtensorModulestorageUpdated Alpha balances after conversion
SubnetAlphaIn SubtensorModulestorageUpdated Alpha supply
AlphaBurned SubtensorModuleeventEmitted when Alpha is deliberately burned via recycle_alpha (not during normal unstaking)

Source Files

pallets/subtensor/src/staking/stake_utils.rs
swap_tao_for_alpha()swap_alpha_for_tao()

Formulas

TAO → Alpha Swap

Swaps route through the concentrated liquidity Swap pallet. Output depends on active tick liquidity.

alpha_out = Swap::swap(tao_in, pool)
// Routes through concentrated liquidity ticks
// Price = 1.0001^tick, slippage depends on active liquidity

TypeScript: swapTaoForAlpha() in yuma-formulas.ts

Alpha → TAO Swap

Sell Alpha for TAO via the concentrated liquidity Swap pallet. Inverse of the buy operation.

tao_out = Swap::swap(alpha_in, pool)
// Routes through concentrated liquidity ticks
// Price = 1.0001^tick, slippage depends on active liquidity

TypeScript: swapAlphaForTao() in yuma-formulas.ts

Alpha AMM Calculator

Alpha AMM Calculator

Simulate TAO/Alpha swaps using a constant-product AMM (x × y = k)

Swap Direction
10,000 TAO in pool
15,000 Alpha in pool
1,000 TAO to swap

Swap Result

Alpha Received
1,363.6364
Alpha
Effective Price
0.733333
TAO per Alpha
Price Impact
21.000%
High impact

Pool State

Before
TAO Reserves 10,000.00
Alpha Supply 15,000.00
Price (TAO/Alpha) 0.666667
k = TAO × Alpha 150.00M
After
TAO Reserves 11,000.00 +1,000.00
Alpha Supply 13,636.36 -1,363.64
Price (TAO/Alpha) 0.806667
k = TAO × Alpha 150.00M

Constant Product Formula: TAO × Alpha = k (constant). When you add TAO to the pool, Alpha comes out, and vice versa. The product always stays the same.

Stake (TAO → Alpha): alpha_out = alpha_supply × tao_in / (tao_reserve + tao_in)

Unstake (Alpha → TAO): tao_out = tao_reserve × alpha_in / (alpha_supply + alpha_in)

Try: Increase the swap amount to see how larger trades cause more price impact. Notice that k stays constant before and after the swap.

Version History

v290 Alpha token system introduced with dTAO
v340 Pool price EMA for smoothed exchange rate display
v360 Slippage protection for large swap operations