StakeAdded
Event v101 → v219, v233 → v252, v257 → v277, v290 → v292, v297 → v298, v301 → v385, v391 → current #2Emitted after stake is successfully transferred from coldkey to hotkey .
View events on chainThe Big Picture
Staking is how TAO holders participate in the network. By staking to a hotkey, you earn a share of that hotkey's emissions from the subnets it operates on. This event confirms your stake is active and earning.
Why This Matters
When you stake TAO, you want to know it worked. This event is your confirmation that your stake is now active and earning rewards from the hotkey's subnet activity.
Example Scenario
You have 100 TAO and want to earn rewards. You stake 50 TAO to a validator's hotkey on subnet 1. When the transaction confirms, StakeAdded fires with your coldkey, the validator's hotkey, 50 TAO amount, and subnet 1. Now you'll earn a share of that validator's emissions proportional to your stake.
Common Questions
- How soon do I start earning after StakeAdded?
- Immediately. Your stake is active from the block this event fires.
- Can I stake to any hotkey?
- Yes, if they're registered on a subnet. But delegates (validators accepting stake) are the most common choice since they share emissions with stakers.
Use Cases
- Track when your stake transaction confirms
- Monitor delegation activity on your validator
- Build staking analytics dashboards
- Trigger notifications when stake is added
How to Use This Event
- → Subscribe to your own coldkey to track your staking activity
- → Subscribe to a validator's hotkey to monitor their total stake
- → Index all events to build staking leaderboards
From Chain Metadata
stake has been transferred from the a coldkey account onto the hotkey staking account.
Migration Notes
arg1 changed from u64 to AccountId; added field arg2 (u64); added field arg3 (u64); added field arg4 (u16)
Update decoders: SCALE encoding is positional, so any signature change (added, removed, or type-changed fields, or storage shape changes) shifts byte offsets and existing decoders will misparse this item. Re-derive types from the new metadata.
added field arg5 (u64)
Update decoders: SCALE encoding is positional, so any signature change (added, removed, or type-changed fields, or storage shape changes) shifts byte offsets and existing decoders will misparse this item. Re-derive types from the new metadata.
Triggers
Emitted by
Preconditions
- Coldkey has sufficient free balance
- Hotkey is registered on at least one subnet
- Amount meets minimum stake requirement
- Coldkey is authorized to stake to this hotkey
Effects
Storage Modified
Postconditions
- Coldkey balance decreased by stake amount
- Hotkey's total stake increased
- Network's TotalStake increased
Side Effects
- May update alpha stake on subnet
- May affect validator ranking if staking to validator
Event Data
| # | Name | Type | Description |
|---|---|---|---|
| 0 | arg0 → coldkey | AccountId | Coldkey funding the stake (or destination coldkey on transfer) (hex -> SS58) |
| 1 | arg1 → hotkey | AccountId | Hotkey receiving the stake (or destination hotkey on transfer) (hex -> SS58) |
| 2 | arg2 → tao_amount | u64 TaoBalance | TAO leg in RAO. Real stake: gross TAO requested by the user (pre-fee). In-subnet transfer: synthetic TAO equivalent at current AMM price. NOT amount_paid_in (post-fee). |
| 3 | arg3 → alpha_received | u64 AlphaBalance | Alpha delivered to the staker by THIS operation, in alpha-RAO. V2-invariant swap output for real stake; share-pool credit on transfer. Per-operation delta, NOT a cumulative Alpha((coldkey, hotkey, netuid)) total. |
| 4 | arg4 → netuid | u16 NetUid | Subnet ID |
| 5 | arg5 → fee_paid_tao | u64 | Swap fee in TAO RAO (PaidIn=TAO for swap_tao_for_alpha), truncated from TaoCurrency. Always 0 for in-subnet transfers (no AMM swap occurs). |
Code Examples
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443
const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);
// Subscribe to StakeAdded events
client.finalizedBlock$.subscribe(async (block) => {
const events = await api.event.SubtensorModule.StakeAdded.get(block.hash);
for (const evt of events) {
console.log("StakeAdded:", evt.payload);
}
});On-Chain Activity
Core protocol operations, high volume
#8 most emitted event
As of block 7,429,232
Version History
Runtime Info
View Source- Pallet Index
- 7
- Event Index
- 2
- First Version
- v101
- Current Version
- v411