SubnetTAO

Storage Map v233 → current

TAO in the subnet liquidity pool.

Explore chain
Queried by: stakersvalidatorsanalyticsdevelopers

The Big Picture

SubnetTAO is the TAO side of the AMM pool. Together with SubnetAlphaIn, it determines the exchange rate for staking and unstaking. More TAO in the pool means alpha is relatively cheaper (you get more alpha per TAO). The constant product (SubnetTAO × SubnetAlphaIn = k) ensures there's always liquidity.

Why This Matters

What's the exchange rate for staking? SubnetTAO is half the equation. TAO/Alpha rate = SubnetAlphaIn / SubnetTAO. This determines how much alpha you receive when you stake.

Example Scenario

Query SubnetTAO(netuid=1) returns 1000000000000000 (1M TAO in RAO). SubnetAlphaIn returns 10T alpha. Rate = 10T / 1M TAO = 10,000 alpha per TAO. Staking 100 TAO gets you ~1M alpha (minus slippage).

Common Questions

Why does this change?
When you stake, you add TAO to the pool (SubnetTAO increases) and receive alpha (SubnetAlphaIn decreases). The opposite happens when unstaking.
What's slippage?
Large trades move the price. If SubnetTAO is 1M and you stake 100K TAO, you're adding 10% to the pool - the rate changes significantly during your trade.
Can the pool run out of TAO?
The AMM curve prevents depletion. As TAO gets scarce, unstaking becomes very unfavorable, naturally discouraging withdrawal.

Use Cases

  • Calculate current TAO/alpha exchange rate
  • Estimate slippage for large stake operations
  • Build AMM pool visualizations and analytics
  • Monitor subnet liquidity depth
  • Track TAO inflows and outflows per subnet

Purpose & Usage

Purpose

Track TAO side of subnet AMM - the other half of the constant product formula.

Common Query Patterns

  • Query by netuid for pool state
  • Combine with SubnetAlphaIn to calculate exchange rate
  • Monitor pool depth for slippage estimation
Part of: Block EmissionTAO FlowAlpha 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 SubnetTAO storage
const key1 = 0;

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

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

On-Chain Activity

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

1M–10M estimated writes

#10 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