terminate_lease

Call v290 → current #111

Terminates a subnet lease early.

View calls on chain

Click items to navigate. Pan and zoom to explore.

Used by: subnet ownersdevelopers

The Big Picture

Leases have durations, but sometimes you need out early. terminate_lease ends your lease before the natural expiration. You likely forfeit remaining lease payments or pay a penalty, but you're free. Better than paying for a subnet nobody uses.

Why This Matters

Sunk cost fallacy can trap you in a failing subnet. If your experiment isn't working, early termination lets you stop the bleeding and redirect resources. The penalty is usually less painful than continuing to operate a failed subnet.

Example Scenario

You leased subnet 55 for 6 months to test a new idea. After 2 months, it's clear the approach won't work. Call terminate_lease(netuid=55). The lease ends, you pay the early termination penalty (say 1 month's fee), but save 3 months of wasted effort and resources.

Common Questions

What's the penalty for early termination?
Depends on lease terms - often a portion of remaining lease value or a fixed fee. Check your lease agreement or network parameters.
Can I get any refund?
Unlikely - you paid for time you're not using. Termination is about cutting losses, not recovering costs.
What happens to miners on the subnet?
Same as normal dissolution - they're deregistered. Give notice if possible so they can prepare to move elsewhere.

Use Cases

  • End a leased subnet experiment early
  • Exit a failed subnet project before lease expires
  • Free up resources for a new subnet
  • Cut losses on an underperforming leased subnet

From Chain Metadata

Terminate a lease. The beneficiary can terminate the lease after the end block has passed and get the subnet ownership. The subnet is transferred to the beneficiary and the lease is removed from storage. **The hotkey must be owned by the beneficiary coldkey.**

Input Parameters

#NameTypeDescription
0
lease_id
u32 lease_id (u32)
1
hotkey
AccountId Hot wallet address (active operations) (hex -> SS58)

Permissions

Origin
Signed
Required Role

Permission data inferred from metadata. May be incomplete.

Requirements

  • Active lease exists for subnet
  • Caller is lease holder or admin
  • Termination conditions met

Effects

Events Emitted

Postconditions

  • Lease terminated
  • Subnet dissolved or released
  • Remaining lease period forfeited

Side Effects

  • May affect deposits/penalties based on early termination terms
  • Miners on subnet are deregistered

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 terminate_lease call
const lease_id = 0;
const hotkey = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";

const call = api.tx[stringCamelCase("SubtensorModule")][stringCamelCase("terminate_lease")](
  lease_id,
  hotkey
);

Runtime Info

View Source
Pallet Index
7
Call Index
111
First Version
v290
Current Version
v393