set_perpetual_lock

Call v411 → current New #138

Toggles whether the caller's individual lock on a subnet is perpetual (never decays) or returns to normal decay.

View calls on chain

Click items to navigate. Pan and zoom to explore.

Used by: stakerssubnet ownersdelegators

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.

Part of: Lock & Conviction

Input Parameters

#NameTypeDescription
0
netuid
u16 NetUidSubnet the perpetual-lock flag applies to
1
enabled
bool True to make the caller's lock perpetual (no decay); false to return to normal decay

Permissions

Origin
Unknown
Required Role

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