toggle_user_liquidity
Call v290 → current #4Enables or disables user liquidity operations for a subnet .
View calls on chainCall Workflow
This diagram shows the call execution flow: starting with toggle_user_liquidity, passing through validation
(signature, nonce, mortality, fee payment), then pre-dispatch checks, followed by dispatch which emits events: UserLiquidityToggled and modifies storage: EnabledUserLiquidity, and finally post-dispatch where ExtrinsicSuccess is emitted and fees are settled.
Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.
Click items to navigate. Pan and zoom to explore.
Used by: subnet ownersdevelopersstakers
The Big Picture
Controls transition between V2 and V3 concentrated liquidity modes.
Use Cases
- Upgrade from V2 to V3 swap mode
- Pause LP additions
From Chain Metadata
Enable user liquidity operations for a specific subnet. This switches the subnet from V2 to V3 swap mode. Thereafter, adding new user liquidity can be disabled by toggling this flag to false, but the swap mode will remain V3 because of existing user liquidity until all users withdraw their liquidity. Only sudo or subnet owner can enable user liquidity. Only sudo can disable user liquidity.
Input Parameters
Permissions
Origin
Unknown
Required Role
Permission data inferred from metadata. May be incomplete.
Requirements
- Caller is sudo or subnet owner
- Subnet exists with subtoken enabled
Effects
Events Emitted
Storage Modified
Postconditions
- EnabledUserLiquidity updated
- If first enable: V3 swap mode active
Side Effects
- Emits UserLiquidityToggled event
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 toggle_user_liquidity call
const netuid = 1;
const enable = true;
const call = api.tx[stringCamelCase("Swap")][stringCamelCase("toggle_user_liquidity")](
netuid,
enable
);Runtime Info
View Source- Pallet Index
- 28
- Call Index
- 4
- First Version
- v290
- Current Version
- v393