set_perpetual_lock
Call v411 → current New #138Toggles whether the caller's individual lock on a subnet is perpetual (never decays) or returns to normal decay.
View calls on chainCall Workflow
Click items to navigate. Pan and zoom to explore.
The Big Picture
Locks decay by default so capital can recycle. Perpetual locks opt out of decay, trading optionality for maximum sustained conviction. Useful for serious long-term positions.
Why This Matters
A perpetual lock is the strongest commitment signal you can make on a subnet. It keeps your locked mass active forever (until you toggle it off).
Example Scenario
You locked 5000 alpha on subnet 3 and intend to hold for years. You call set_perpetual_lock(netuid=3, enabled=true). The lock stops decaying and your conviction continues accruing without erosion.
Use Cases
- Commit to a permanent position on a subnet
- Maximize long-term conviction for owner-cut allocation
- Toggle off perpetual when you want to eventually exit
From Chain Metadata
Sets or clears the caller's perpetual lock flag for a subnet. Locks decay by default. When enabled, the caller's individual lock does not unlock through locked-mass decay. Passing `false` returns the caller's lock to normal decay.
Input Parameters
Permissions
Permission data inferred from metadata. May be incomplete.
Requirements
- Coldkey signs the call
- A lock exists for (coldkey, subnet)
Effects
Postconditions
- DecayingLock entry inserted or removed for (coldkey, subnet)
- PerpetualLockUpdated event emitted
Side Effects
- When enabled, the caller's locked mass no longer decays via UnlockRate
- When disabled, normal decay resumes from the current locked amount
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);
// Build set_perpetual_lock call (typed, named args)
const netuid = 1;
const enabled = true;
const tx = api.tx.SubtensorModule.set_perpetual_lock({
netuid,
enabled,
});Runtime Info
View Source- Pallet Index
- 7
- Call Index
- 138
- First Version
- v411
- Current Version
- v411