Alpha Token Conversion
StakingConversion between TAO and subnet-specific Alpha tokens via concentrated liquidity AMM in the Swap pallet.
Alpha Token AMM
Alpha Token Conversion
- Stake add/remove operations
- Emission distribution at epoch boundaries
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)
| Item | Type | Role |
|---|---|---|
| SubnetAlphaIn SubtensorModule | storage | Current Alpha supply per subnet |
| SubnetTAO SubtensorModule | storage | TAO reserve in each subnet pool |
Outputs (3)
| Item | Type | Role |
|---|---|---|
| Alpha SubtensorModule | storage | Updated Alpha balances after conversion |
| SubnetAlphaIn SubtensorModule | storage | Updated Alpha supply |
| AlphaBurned SubtensorModule | event | Emitted when Alpha is deliberately burned via recycle_alpha (not during normal unstaking) |
Source Files
pallets/subtensor/src/staking/stake_utils.rs 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 Result
Pool State
Before
After
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.