StakeLocked
Event v411 → current New #126Emitted when a coldkey locks alpha stake on a hotkey /subnet .
View events on chainUseful for: stakerssubnet ownersvalidatorsanalyticswallets
The Big Picture
StakeLocked is the on-chain trail of the conviction system. Every lock_stake call emits one of these. Aggregating them tells you who's committing for the long term and on which subnets.
Use Cases
- Confirm a lock_stake transaction settled
- Build dashboards of locked stake per validator or per subnet
- Track conviction-building activity over time
How to Use This Event
- → Indexers track this to compute per-validator locked alpha
- → Dashboards filter by netuid to show subnet conviction trends
From Chain Metadata
Stake has been locked to a hotkey on a subnet.
Triggers
Emitted by
Preconditions
- lock_stake call succeeded
- Hotkey is registered on root
- Coldkey-hotkey association valid
May fail with
NotEnoughStaketoWithdrawNotEnoughStakeNotEnoughStakeToWithdrawNotEnoughStakeToSetWeightsStakeToWithdrawIsZeroNotEnoughStakeToSetChildkeysNotEnoughBalanceToStakeStakeAlreadyAddedStakeRateLimitExceededUnstakeRateLimitExceededStakeTooLowForRootBelowStakeThresholdNomStakeBelowMinimumThresholdCannotUnstakeLockStakeUnavailableZeroMaxStakeAmountSameAutoStakeHotkeyAlreadySetAddStakeBurnRateLimitExceededInsufficientStakeForLock
Effects
Postconditions
- Lock storage updated for (coldkey, subnet, hotkey)
- HotkeyLock storage updated
- Locked alpha is no longer available for unstaking
Side Effects
- Conviction begins accruing against the locked amount
Event Data
| # | Name | Type | Description |
|---|---|---|---|
| 0 | coldkey | AccountId | Coldkey that locked the stake (hex -> SS58) |
| 1 | hotkey | AccountId | Hotkey the stake is locked to (hex -> SS58) |
| 2 | netuid | u16 NetUid | Subnet the lock is on |
| 3 | amount → alpha_amount | u64 AlphaBalance | Alpha amount locked (in alpha-RAO; 1 alpha = 10^9 alpha-RAO) (RAO -> TAO (/ 10^9)) |
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 StakeLocked events
client.finalizedBlock$.subscribe(async (block) => {
const events = await api.event.SubtensorModule.StakeLocked.get(block.hash);
for (const evt of events) {
console.log("StakeLocked:", evt.payload);
}
});Runtime Info
View Source- Pallet Index
- 7
- Event Index
- 126
- First Version
- v411
- Current Version
- v411