Guide to Dynamic TAO
The Emissions section in this dynamic TAO guide is still not settled yet. Proceed with caution.
Follow this guide to learn the essential concepts, features and mechanisms of dynamic TAO.
Skip to Intuitions of dynamic TAO.
Subnet pool
The heart of the dynamic TAO mechanism is a subnet pool, with the following properties:
- Associated with each subnet is a subnet pool.
- A subnet pool consists of two token reserves, a TAO token reserve and a subnet-specific token reserve.
- Each subnet has its own token. For example, is the token for subnet , and is the token for subnet , and so on. Note that the term is also used to refer to any token, not just the token for the subnet .
- All token exchanges between TAO and occur through the subnet pool. The subnet pool's reserve ratio determines the exchange rate.
TAO reserve and alpha reserve
The TAO side of a subnet pool's reserves are denoted by , or TAO reserve, and are expressed in units of TAO. Similarly, the side of the pool reserves are denoted by , or alpha reserves. The terms and alpha reserves are general terms and refer to the pool reserves of all subnets, including that of subnet .
Rate
We use the term rate to refer to relative price of the token. This is calculated as a ratio of the subnet's pool reserve, i.e., ratio of TAO reserve and alpha reserves. This is commonly referred as the exchange rate between the subnet token and the TAO token.
Example
For example, if for subnet , its subnet pool contains TAO reserves of 1000 TAO units and its alpha reserves of 16000 units, then the relative price of the token is:
Hence,
This exchange rate can change every block when staking or unstaking or emissions occur on this subnet.
Staking
With dynamic TAO, staking works as follows. See the below diagram.
- Under the dynamic TAO, as a TAO holder you would still stake to a validator’s hotkey, but now you can also select a subnet (
netuid
) of your choice. When you runbtcli stake add
command, the TAO you want to stake first goes into the subnet pool. - The TAO to be staked is added to the TAO reserves side of the subnet pool.
- The subnet pool algorithm uses the exchange rate and calculates the equivalent units of , for the TAO that was just added to the TAO reserve side. This amount of is taken out of the alpha reserve of the pool and is sent to the validator’s hotkey.
- The validator’s hotkey holds the . This is referred as Stake ().
In dynamic TAO, except for the stake held in subnet zero, the stake held by a hotkey in a subnet is always expressed in the subnet-specific units and not TAO units.
Constant product k
The subnet pool algorithm is set up to always maintain a constant product of the two reserves. That is,
Anytime either of the reserves increases, for example as a result of a random external action such as some stake TAO entering the pool, the subnet pool algorithm automatically recalculates, using the new reserves, how much the other reserve should decrease in order to maintain the same constant product .
Staking and unstaking operations do not change the constant product , but result in slippage due to the fact that these are exchange (i.e., swap) operations. On the contrary, emissions into a subnet pool do change the constant product but do not result in slippage, due to the fact that these are not swap operations. See Slippage. Also see Emissions.
Slippage
When we stake we exchange TAO for the alpha token in the pool. The following occurs while we stake:
- Prior to the staking operation, we know the expected price of the alpha token. This expected price is the reserve ratio, as described in Rate, prior to the staking operation.
- However, the very action of our staking changes the token reserve ratio, because we are adding TAO to the TAO reserves.
- Mathematically the pool is required to maintain the constant product . As a result, the pool algorithm automatically adjusts the alpha token reserves to keep the constant product unchanged. This results in a change in the reserve ratio.
- This means that the actual price at which our staking operation is executed is different from our original expected price of the alpha token. This difference between the original expected alpha token price and the actual actual token price at which staking operation is performed is called slippage.
Example
As described in the Staking section, a staking event results in the staked TAO being added to the τ_in reserves of the subnet pool. The subnet pool algorithm calculates the number of units by which the reserves should decrease. These units are then taken out of the reserves and sent to the validator’s hotkey in the subnet. See an example below.
The below example shows how staking 5 TAO works.
Let us assume the following initial state of TAO and reserves in a subnet:
- TAO reserves: 10 TAO tokens
- reserves: 100 tokens
Hence, the constant product 𝑘 = 10 × 100 =1000.
Without slippage
- Expected price of token:
- Hence, the expected number of α tokens:
With slippage
- Initial relative price of is = reserve ratio of subnet pool = (TAO token reserves of pool )/( token reserves) = 10/100 = 0.1 TAO.
- Stake 5 TAO: This adds 5 TAO into the TAO reserves of the pool. Hence, the new TAO reserve = 10 + 5 = 15 TAO tokens.
- Using the new TAO reserve of 15, the subnet pool algorithm calculates what should be the new reserves, in order to maintain k at 1000.
- Calculating:
- Hence, the that is taken out of the reserve and sent to the validator’s hotkey is:
Hence, when you stake 5 TAO, your stake is , taking into account the slippage. As a result:
- Slippage in terms of tokens:
- The percentage of slippage:
Effect of slippage
- TAO reserves: 15 tokens
- reserves: 66.67 tokens
- Constant product 𝑘 = 15 × 66.67 = 1000 (unchanged)
- New relative price of after the staking event = reserve ratio of subnet pool = (TAO token reserves of pool )/( token reserves) = 15/66.67 = 0.225 TAO.
- Price impact due to slippage: As a result of the slippage, staking 5 TAO into subnet changed the relative price of token: it increased from 0.1 TAO to 0.225 TAO. All else being equal, slippage leads to an increase in token's relative price when we stake.
Stake or alpha outstanding
Total stake in the subnet is referred as . This is the sum of all the Stake present in all the validator hotkeys in this subnet. This is often referred as outstanding. Compare this with reserve, which is the amount of in the subnet pool. The outstanding can change every block. See a conceptual diagram below:
Hotkey's stake share
A hotkey's share of the total outstanding alpha tokens in the subnet is calculated as:
The hotkey's stake share represents the local stake power of the hotkey within the subnet.
Unstaking
Unstaking works, not surprisingly, as a reverse of the staking operation. See the below diagram.
- When you issue an unstake command,
btcli stake remove
, and specify the units of token you want to unstake, this is first taken out of the validator’s hotkey and added to the reserves of the subnet pool. - The subnet pool algorithm then applies the latest exchange rate and calculates the equivalent TAO units for the token units that were just added to the reserves of the pool.
- These equivalent TAO units are then taken out of the TAO reserves of the subnet pool and are sent to the TAO holder’s coldkey.
Example
The below example shows how unstaking 20 works. Let’s continue with the state of the TAO and reserves after the above staking operation:
- TAO reserves: 15 tokens
- reserves: 66.67 tokens
- Constant product 𝑘 = 15 × 66.67 = 1000
Without slippage
See Slippage if you are not familiar with it.
- Expected price of token before unstaking:
- Hence, the expected number of TAO tokens:
With slippage
- Relative price is = reserve ratio of subnet pool = (TAO token reserves of pool )/( token reserves) = 15/66.67 = 0.225 TAO (same as the relative price after the above staking operation)
- Unstake 20 : This adds 20 to the side of the pool. New reserves = 66.67 + 20 = 86.67 tokens.
- Using the new reserve of 86.67, the subnet pool algorithm calculates what should be the new TAO reserve in order to maintain at 1000.
- Calculating:
- Hence, the TAO that is taken out of the TAO reserves of the pool and sent to the TAO holder’s coldkey is: 15 − 11.54 = 3.46 TAO.
Hence, when you unstake 20 , your unstaked TAO is , taking into account the slippage. As a result:
- Slippage in terms of TAO tokens:
- The percentage of slippage:
Effect of slippage
- TAO reserves: 11.54 TAO tokens
- reserves: 86.67 tokens
- Constant product 𝑘 = 11.54 × 66.67 = 1000 (unchanged)
- New relative price of after the unstaking event = reserve ratio of subnet pool = (TAO token reserves of pool )/( token reserves) = 11.54/86.67 = 0.133 TAO per .
- Price impact due to slippage: As a result of slippage, unstaking 20 changed the price: it decreased from 0.225 TAO to 0.113 TAO. All else being equal, unstaking from a subnet leads to a decrease in its token's relative price.
Local weight or TAO Equiv
A hotkey's stake, i.e., stake(α), represents subnet-specific stake. As a result, a hotkey's stake share can only represent the validator's staking power within the subnet. Moreover, an token of a subnet is not fungible with an token of another subnet. For this very reason, when a hotkey is validating in multiple subnets, the hotkey's stake share in one subnet cannot be simply added to the same hotkey's stake share in a different subnet.
This is where the TAO-equivalent value of the hotkeys stake share (α / α_out) comes into play. As we saw in the Staking section, any TAO staked into a subnet is added to the TAO reserves of the subnet pool, i.e., added to τ_in. Similarly any TAO unstaked from a subnet is removed from the TAO reserves of the subnet pool. As a consequence, τ_in reserve represents the total voting power of the subnet as a whole. Hence,
represents the hotkey's local voting power proportional to its stake share in the subnet. It is calculated as:
and is expressed in TAO units. This can change every block.
This local voting power or local weight represents the hotkey's influence in the subnet.
Example
For example, for a validator's hotkey in a given subnet:
-
Total outstanding alpha (α_out) = 30,000 alpha tokens.
-
The hotkey's alpha stake () = 6,000 alpha tokens.
-
TAO reserve in the subnet's pool (τ_in) = 5,000 TAO.
-
Then, this validator's hotkey stake share = (6,000/30,000) = 0.2 or 20%.
-
Hence, this validator hotkey's local voting power, i.e., local weight = τ_in x hotkey's stake share = 5000 x 0.2 = 1000 TAO.
Hence, while the hotkey's stake share in this subnet is 20%, its actual local weight (local voting power) in the subnet is 1,000 TAO units. This is the power of dynamic TAO mechanism. It converts a hotkey's alpha stake share into an equivalent TAO-denominated voting power in the subnet. This makes alpha stakes comparable across different subnets, even though these subnets might have very different amounts of alpha tokens outstanding.
Local weights vs TAO reserve
In any subnet, if you add up the local weights of all alpha holders, you will always get exactly the TAO reserve () of that subnet.
This means:
- The total voting power in a subnet is fixed by its TAO reserve ().
- For a given , if a validator's hotkey in a subnet increases their local weight, it must come at the expense of others.
Subnet zero
In dynamic TAO, subnet zero is a special subnet. It is designed to provide the following benefits:
- The subnet zero is the only subnet that does not have any subnet pool associated with it. TAO holders can only stake into subnet zero in TAO token denominations. Hence, TAO holders and validators who prefer not to think about either subnet-specific staking or about tokens can stake in subnet zero. Their stake will remain in TAO denomination in the validator hotkeys as there is no notion of alpha in subnet zero.
- The subnet zero is also the only subnet that does not have any validating or mining defined on it. Incentive mechanisms cannot be run in subnet zero. Nevertheless, a validator's hotkey registered in subnet zero will accept stake TAO.
- Because there is no subnet pool attached to the subnet zero, a validator hotkey's local weight in subnet zero is simply the raw TAO units that exist as stake in this hotkey.
As a rule, you can only stake in TAO denomination in subnet zero, and only in the subnet-specific denomination in all other subnets. Hence, stake in subnet zero is always expressed in TAO units.
Global weight
Global weight of a validator hotkey is the sum of the local weights for all the subnets, including subnet zero, where this hotkey is validating.
Example
Let's say that a validator's hotkey has the following positions in four different subnets, including in subnet zero.
-
Subnet zero:
- validator's stake: 1000 TAO
- validator's stake share: 10% (i.e., out of all TAO stake in subnet zero, this validator holds 10% of it)
-
Gaming subnet:
- validator's stake share = (α / α_out) = 30%
- τ_in in this subnet pool = 10,000 TAO
-
AI subnet:
- validator's stake share = (α / α_out) = 40%
- τ_in in this subnet pool = 15,000 TAO
-
Storage subnet:
- validator's stake share = (α / α_out) = 20%
- τ_in in this subnet pool = 5,000 TAO
Hence, the local weights, or local voting power of this hotkey in each subnet are as below:
- For subnet zero: 1000 TAO (TAO number used as is, without any multiplier, see subnet zero)
- Gaming subnet: = 0.30 × 10,000 = 3,000 TAO
- Similarly, for AI subnet: 0.40 × 15,000 = 6,000 TAO
- For Storage subnet: 0.20 × 5,000 = 1,000 TAO
Hence the global weight of this hotkey is: 1000 + 3000 + 6000 + 1000 = 11,000 TAO.
Root weight
Notice that in the above calculation, we used the hotkey's subnet zero stake of 1000 TAO as it is while calculating the global weight of the hotkey. However, in dynamic TAO it is normal to multiply the subnet zero stake TAO number by a factor called root_weight
that varies from 0 to 1.
Hence, for root_weight
of 0.5, the subnet zero stake of the hotkey will now be root_weight
x 1000 = 0.5 x 1000 = 500 TAO. Hence, under this condition, the updated global weight of this hotkey is: 500 + 3000 + 6000 + 1000 = 10,500 TAO.
Global weight vs. local weight
The two quantities defined above for a validator hotkey, i.e., the hotkey's global weight (across all subnets where it is validating) and its local weight (per subnet), are critically important.
In addition to the local weight of a hotkey in a subnet, this hotkey's global weight also appears in this subnet. This is why global weight of a validator's hotkey is critical.
Note that in the above, both local weight and global weight of a hotkey are expressed in TAO units. However, to represent a validator hotkey's overall stake weight in a subnet, instead of using the two individual TAO units (one for global weight and second for local weight), a new quantity called validator's stake weight in a subnet, is defined as follows:
- The local weight of a hotkey is normalized with respect to the sum of all the local weights of all other hotkeys in this subnet, so that they all sum to 1.0. This normalized local weight represents the hotkey's relative proportion of its influence in the subnet.
- Similarly the global weight of the hotkey is normalized with respect to the sum of all the global weights of all other hotkeys for the subnets in question, to sum to 1.0. This normalized global weight represents the hotkey's relative proportion of its influence in the subnets in question.