spot_set_leverage

Set leverage for SPOT margin trading. Provide exactly ONE of instId (pair-level) or ccy (currency-level cross, requires borrow-enabled account / multi-ccy / portfolio margin). [CAUTION] Changes risk parameters. Scenarios: • instId + mgnMode=isolated -> pair-level isolated margin • instId + mgnMod...

Server Okx Trade @okx_ai/okx-trade-mcp
Category Write
Risk class Medium
Parameters 42 required

What spot_set_leverage does on Okx Trade

AI agents use spot_set_leverage to create or update resources in Okx Trade — usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Okx Trade environment.

ParameterTypeRequiredDescription
ccy string Margin currency, e.g. BTC. Required only for currency-level cross margin (borrow-enabled / multi-ccy / portfolio margin). Mutually exclusive with instId.
lever string Yes Leverage multiplier as a positive number string, e.g. '3'. Max depends on the pair (query market_get_instruments -> lever) or the account policy for ccy-level.
instId string Spot pair, e.g. BTC-USDT. Provide instId OR ccy, not both.
mgnMode string Yes cross or isolated. Must be cross when ccy is supplied.

Parameters from the server's own tool schema.

Why spot_set_leverage needs a policy

This tool modifies leverage settings (a risk parameter) on a trading account. It doesn't directly move money or execute trades, but changing leverage can dramatically affect exposure and liquidation risk. It's a Write operation (modifying account configuration) with high severity because misconfigured leverage can lead to forced liquidations and significant financial loss.

From the tool's definition Set leverage for SPOT margin trading... [CAUTION] Changes risk parameters.

Questions about spot_set_leverage

What does the spot_set_leverage tool do? +

Set leverage for SPOT margin trading. Provide exactly ONE of instId (pair-level) or ccy (currency-level cross, requires borrow-enabled account / multi-ccy / portfolio margin). [CAUTION] Changes risk parameters. Scenarios: • instId + mgnMode=isolated -> pair-level isolated margin • instId + mgnMode=cross -> pair-level cross margin (contract-mode account) • ccy + mgnMode=cross -> currency-level cross margin (spot-with-borrow / multi-ccy / portfolio margin) When ccy is supplied, mgnMode MUST be cross. posSide is never applicable to spot margin. It is categorised as a Write tool in the Okx Trade MCP Server, which means it can create or modify data. Consider rate limits to prevent runaway writes.

What parameters does spot_set_leverage accept? +

spot_set_leverage accepts 4 parameters: ccy, lever, instId, mgnMode. Required: lever, mgnMode. The full parameter table on this page comes from the server's own tool schema.

How do I enforce a policy on spot_set_leverage? +

Register the Okx Trade MCP server in PolicyLayer and add a rule for spot_set_leverage: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Okx Trade. Nothing to install.

What risk level is spot_set_leverage? +

spot_set_leverage is a Write tool with medium risk. Write tools should be rate-limited to prevent accidental bulk modifications.

Can I rate-limit spot_set_leverage? +

Yes. Add a rate_limit block to the spot_set_leverage rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.

How do I block spot_set_leverage completely? +

Set action: deny in the PolicyLayer policy for spot_set_leverage. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.

What MCP server provides spot_set_leverage? +

spot_set_leverage is provided by the Okx Trade MCP server (@okx_ai/okx-trade-mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.

// LOOK UP ANOTHER SERVER

Every MCP server has a record like this.

Type a name, get the same breakdown: verified identity, auth posture, risk grade, capabilities, recommended policy.

Teams ship this data inside their own products. See what a licence covers →

// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.