StakeUnlocked
Event v411 → current New #127Emitted when locked alpha decays out or is released, becoming liquid again.
View events on chainUseful for: stakerssubnet ownersvalidatorsanalytics
The Big Picture
Locks decay continuously, but the chain emits StakeUnlocked when an unlock crosses a meaningful threshold. Use this to follow the back side of the conviction lifecycle.
Use Cases
- Detect when previously locked alpha frees up
- Track decay rates in practice vs the configured UnlockRate
- Alert holders that their lock has finished decaying
From Chain Metadata
Stake has been unlocked from a hotkey on a subnet.
Triggers
Preconditions
- Existing lock decayed via UnlockRate or was released explicitly
May fail with
NotEnoughStaketoWithdrawNotEnoughStakeNotEnoughStakeToWithdrawNotEnoughStakeToSetWeightsStakeToWithdrawIsZeroNotEnoughStakeToSetChildkeysNotEnoughBalanceToStakeStakeAlreadyAddedStakeRateLimitExceededUnstakeRateLimitExceededStakeTooLowForRootBelowStakeThresholdNomStakeBelowMinimumThresholdCannotUnstakeLockStakeUnavailableZeroMaxStakeAmountSameAutoStakeHotkeyAlreadySetAddStakeBurnRateLimitExceededInsufficientStakeForLock
Effects
Postconditions
- Locked amount decreased in Lock and HotkeyLock storage
- Alpha returns to liquid stake on the hotkey/subnet
Side Effects
- Conviction proportionally reduced
- Owner-cut weight share recalculated next epoch
Event Data
| # | Name | Type | Description |
|---|---|---|---|
| 0 | coldkey | AccountId | Coldkey whose stake was unlocked (hex -> SS58) |
| 1 | hotkey | AccountId | Hotkey the stake was locked to (hex -> SS58) |
| 2 | netuid | u16 NetUid | Subnet the lock was on |
| 3 | amount → alpha_amount | u64 AlphaBalance | Alpha amount returned to liquid stake via UnlockRate decay (in 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 StakeUnlocked events
client.finalizedBlock$.subscribe(async (block) => {
const events = await api.event.SubtensorModule.StakeUnlocked.get(block.hash);
for (const evt of events) {
console.log("StakeUnlocked:", evt.payload);
}
});Runtime Info
View Source- Pallet Index
- 7
- Event Index
- 127
- First Version
- v411
- Current Version
- v411