SubnetAlphaIn

Storage Map v233 → current

Alpha tokens in the subnet liquidity pool.

Explore chain
Queried by: stakersvalidatorsanalyticsdevelopers

The Big Picture

SubnetAlphaIn and SubnetTAO form a constant-product AMM (like Uniswap). When you stake TAO, you deposit TAO and withdraw alpha from this pool. The ratio determines your exchange rate. Large SubnetAlphaIn relative to SubnetTAO means alpha is 'cheap' (you get more alpha per TAO staked).

Why This Matters

How much alpha will you get for your TAO? SubnetAlphaIn is one half of the answer. Combined with SubnetTAO, you can calculate the exact exchange rate and predict how your stake affects it.

Example Scenario

Query SubnetAlphaIn(netuid=1) returns 10000000000000 (10T). SubnetTAO(netuid=1) returns 1000000000000 (1T TAO). Rate = 10T alpha / 1T TAO = 10 alpha per TAO. Staking 1 TAO gets you ~10 alpha (minus slippage).

Common Questions

How is this different from TotalAlpha?
SubnetAlphaIn is alpha in the pool (available for exchange). TotalAlpha is all alpha including what's already staked to validators. SubnetAlphaIn ⊂ TotalAlpha.
Why does the rate change?
Constant product: SubnetAlphaIn × SubnetTAO = k. When you add TAO (stake), you remove alpha, changing the ratio. Large stakes cause more slippage.
What's a healthy pool balance?
Deeper pools (more of both assets) mean less slippage. A balanced ratio depends on subnet economics and isn't inherently good or bad.
Can the pool run out of alpha?
In practice, no - the AMM curve prevents total depletion. But very low SubnetAlphaIn means extremely unfavorable rates for stakers (alpha becomes very expensive).

Use Cases

  • Calculate current TAO/alpha exchange rate
  • Estimate slippage for stake/unstake operations
  • Build AMM pool visualizations
  • Monitor pool depth and liquidity
  • Analyze staking/unstaking impact on rates

Purpose & Usage

Purpose

Track alpha available in AMM pool - one side of the TAO/alpha constant product.

Common Query Patterns

  • Query by netuid for pool state
  • Combine with SubnetTAO to calculate exchange rate
  • Monitor pool balance changes
Part of: Block EmissionTAO FlowEpoch ProcessingAlpha Token Conversion

Query Keys

#NameTypeDescription
1
key1
u16 key1 (u16)

Stored Value

Value in RAO (÷10⁹ for TAO)

RAO -> TAO (/ 10^9)

Relationships

Code Examples

import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";

const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });

// Query SubnetAlphaIn storage
const key1 = 0;

const result = await api.query
  [stringCamelCase("SubtensorModule")]
  [stringCamelCase("SubnetAlphaIn")](
  key1
);

console.log("SubnetAlphaIn:", result.toHuman());

On-Chain Activity

Write Frequency
●●●●●○ High 1M–10M est. writes

1M–10M estimated writes

#12 most written storage item

Write Source User Extrinsics

Modified via user-submitted extrinsics

As of block 7,429,232

Runtime Info

View Source
Pallet
SubtensorModule
Storage Kind
Map
First Version
v233
Current Version
v393