set_coldkey_auto_stake_hotkey
Call Re-added v315 → v323, v326 → current #114Sets the auto-stake destination for a coldkey .
View calls on chainCall Workflow
Click items to navigate. Pan and zoom to explore.
The Big Picture
Normally, emissions arrive as liquid TAO that sits in your wallet. Auto-stake changes this - instead of receiving TAO, your rewards automatically stake to a designated hotkey. This is compounding on autopilot. No transactions, no gas fees for restaking, just continuous growth of your staked position.
Why This Matters
Manual restaking is tedious and costs gas. If you're a long-term staker who would restake anyway, auto-stake saves time and money. Your rewards immediately start earning more rewards, maximizing compound growth.
Example Scenario
You stake 1000 TAO to ValidatorX and want all rewards to compound. Call set_coldkey_auto_stake_hotkey(hotkey=ValidatorX). Now when you earn 10 TAO in rewards, instead of receiving liquid TAO, it automatically stakes to ValidatorX. Your position grows without any action required.
Common Questions
- Can I auto-stake to a different hotkey than I'm currently staked to?
- Yes - the auto-stake destination is independent of existing stakes. You could be staked to 5 validators but auto-stake rewards to a 6th one.
- How do I stop auto-staking?
- Call the function again with a null or zero hotkey (check exact API). Or you may need to use a separate disable call. Once disabled, rewards arrive as liquid TAO.
- Does auto-stake work across all subnets?
- Auto-stake goes to the specified hotkey. Which subnet the stake lands on depends on the hotkey's registrations and the call's netuid parameter if applicable.
- What about gas fees for auto-staking?
- Auto-stake happens at the protocol level during emission distribution. You don't pay gas for each auto-stake - it's part of the emission processing.
Use Cases
- Automatically compound earnings by restaking to a validator
- Hands-free delegation management
- Reduce transaction frequency by auto-staking rewards
- Set up passive income with automatic reinvestment
From Chain Metadata
Set the autostake destination hotkey for a coldkey. The caller selects a hotkey where all future rewards will be automatically staked.
Input Parameters
Permissions
Permission data inferred from metadata. May be incomplete.
Requirements
- Caller is valid coldkey
- Hotkey is registered on at least one subnet
- Hotkey accepts staking from this coldkey
Effects
Events Emitted
Storage Modified
Postconditions
- Future rewards auto-stake to this hotkey
- AutoStakeHotkey preference stored
Side Effects
- Changes where automatic staking goes
- Affects all future emission distributions
Possible Errors
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 });
// Build set_coldkey_auto_stake_hotkey call
const netuid = 1;
const hotkey = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
const call = api.tx[stringCamelCase("SubtensorModule")][stringCamelCase("set_coldkey_auto_stake_hotkey")](
netuid,
hotkey
);Version History
Runtime Info
View Source- Pallet Index
- 7
- Call Index
- 114
- First Version
- v315
- Current Version
- v393