Trading
Trading tools to place, edit, and cancel orders, manage brackets, leverage, margin, and positions. Off by default; requires a Trading key and DELTA_MCP_MODE=trade.
These tools place and change real orders and positions. They register only
when you opt in with DELTA_MCP_MODE=trade and supply a key with Trading
permission (see Authentication). Without that the server
stays read-only and none of the tools below exist.
These tools move real money
Mutations execute against your live account. Always dry-run first (every tool
takes dry_run: true, which validates and echoes the exact payload without
sending it), read it back, then confirm. Every call — dry-run or real — is written
to an audit log. Mutations are never auto-retried.
The dry-run-first pattern
Every tool here takes a dry_run flag (default false). Ask for the dry run,
read the echoed payload, then say "send it". This is the recommended way to use
every tool on this page.
Place a reduce-only limit sell of 10 BTCUSD contracts at 72000 — dry run first.The assistant calls the tool with dry_run: true, you see the exact order it
would send ({ "dry_run": true, "method": "POST", "path": "/orders", "payload": {...} }),
and nothing is placed until you confirm.
Prices are tick-rounded. Price params are rounded to the product's tick size
before sending; the response carries an adjustments / price_adjustments block
showing any value that changed.
place_order
Place a single limit, market, or stop order. Supports attached brackets.
Auth: Trading key + trade mode
| Param | Type | Required | Notes |
|---|---|---|---|
size | int | yes | order size in contracts (positive) |
side | string | yes | buy or sell |
order_type | string | yes | limit_order or market_order |
product_id | int | no | pass exactly one of product_id / product_symbol |
product_symbol | string | no | e.g. BTCUSD |
limit_price | string | no | required for limit_order; rejected on market_order |
stop_order_type | string | no | stop_loss_order or take_profit_order |
stop_price | string | no | trigger price for stop orders |
trail_amount | string | no | trailing-stop amount |
stop_trigger_method | string | no | mark_price, last_traded_price, spot_price |
time_in_force | string | no | gtc or ioc |
post_only | bool | no | reject if it would take liquidity |
reduce_only | bool | no | only reduce an existing position |
client_order_id | string | no | your id, max 32 chars |
bracket_stop_loss_price | string | no | attached-bracket SL trigger |
bracket_stop_loss_limit_price | string | no | attached-bracket SL limit |
bracket_take_profit_price | string | no | attached-bracket TP trigger |
bracket_take_profit_limit_price | string | no | attached-bracket TP limit |
bracket_trail_amount | string | no | attached-bracket trailing amount |
bracket_stop_trigger_method | string | no | trigger method for the bracket |
dry_run | bool | no | validate + echo the payload without sending |
Passing the bracket_* params here creates an entry-order bracket whose id
(the returned order id) is what edit_bracket_order later expects. (That differs
from place_bracket_order, which attaches a bracket to an open position.)
Dry-run a GTC limit buy of 5 ETHUSD at 3400 with a take-profit at 3600 and a
stop-loss at 3250. Show me the payload before sending.edit_order
Edit an open order's size or price.
Auth: Trading key + trade mode
| Param | Type | Required | Notes |
|---|---|---|---|
id | int | yes | order id to edit |
size | int | yes | total size after the edit |
product_id | int | no | pass exactly one of product_id / product_symbol |
product_symbol | string | no | e.g. BTCUSD |
limit_price | string | no | new limit price |
stop_price | string | no | new stop trigger price |
trail_amount | string | no | new trailing-stop amount |
post_only | bool | no | reject if it would take liquidity |
dry_run | bool | no | validate + echo the payload without sending |
Move my open BTCUSD order 123456789 to a limit price of 71500 — dry run first.cancel_order
Cancel a single order by id or client order id.
Auth: Trading key + trade mode
| Param | Type | Required | Notes |
|---|---|---|---|
product_id | int | yes | product the order belongs to |
id | int | no | order id to cancel |
client_order_id | string | no | your client order id |
dry_run | bool | no | validate + echo the payload without sending |
Pass exactly one of id or client_order_id.
Cancel my open BTCUSD order 123456789.cancel_all_orders
Cancel open orders, optionally scoped by product or contract type.
Auth: Trading key + trade mode
| Param | Type | Required | Notes |
|---|---|---|---|
product_id | int | no | limit to one product |
contract_types | string[] | no | limit to contract types (ignored if product_id set) |
cancel_limit_orders | bool | no | include limit orders |
cancel_stop_orders | bool | no | include stop orders |
cancel_reduce_only_orders | bool | no | include reduce-only orders |
dry_run | bool | no | validate + echo the payload without sending |
With no filters this cancels everything
If you set none of the cancel_* flags, all three default to true so "cancel
all" cancels every open order. Set a flag explicitly, or pass product_id /
contract_types, to narrow the scope. Dry-run it first.
Cancel all my open orders on BTCUSD — dry run first so I can see what's affected.place_batch_orders
Place up to 50 orders on one contract in a single request.
Auth: Trading key + trade mode
| Param | Type | Required | Notes |
|---|---|---|---|
orders | object[] | yes | up to 50; each {size, side, order_type, limit_price?, time_in_force?, post_only?, client_order_id?}. Same contract. No IOC/stop. |
product_id | int | no | pass exactly one of product_id / product_symbol |
product_symbol | string | no | e.g. BTCUSD |
dry_run | bool | no | validate + echo the payload without sending |
client_order_id must be unique within the batch. If the exchange processes
fewer orders than sent, the response carries a partial_failure block listing
the dropped ids without hiding the ones that went live.
Dry-run a ladder of 5 BTCUSD limit buys: 2 contracts each at 70000, 69500, 69000,
68500, 68000.edit_batch_orders
Edit up to 50 orders on one contract in a single request.
Auth: Trading key + trade mode
| Param | Type | Required | Notes |
|---|---|---|---|
orders | object[] | yes | up to 50; each {id, size, order_type, limit_price?, post_only?} |
product_id | int | no | pass exactly one of product_id / product_symbol |
product_symbol | string | no | e.g. BTCUSD |
dry_run | bool | no | validate + echo the payload without sending |
Reprice all my open ETHUSD ladder orders down by 50 — dry run first.cancel_batch_orders
Cancel up to 50 orders on one contract in a single request.
Auth: Trading key + trade mode
| Param | Type | Required | Notes |
|---|---|---|---|
orders | object[] | yes | up to 50; each {id} or {client_order_id} |
product_id | int | no | pass exactly one of product_id / product_symbol |
product_symbol | string | no | e.g. BTCUSD |
dry_run | bool | no | validate + echo the payload without sending |
Cancel orders 111, 222, and 333 on BTCUSD in one request.place_bracket_order
Attach a take-profit / stop-loss bracket to an open position. Provide at least one leg.
Auth: Trading key + trade mode
| Param | Type | Required | Notes |
|---|---|---|---|
product_id | int | no | pass exactly one of product_id / product_symbol |
product_symbol | string | no | e.g. BTCUSD |
stop_loss_order | object | no | {order_type, stop_price, limit_price?, trail_amount?} |
take_profit_order | object | no | {order_type, stop_price, limit_price?} |
bracket_stop_trigger_method | string | no | mark_price, last_traded_price, spot_price |
dry_run | bool | no | validate + echo the payload without sending |
These position-bracket legs are not editable via edit_bracket_order — cancel
and re-place to change them. (edit_bracket_order only edits entry-order brackets
created through place_order.)
On my open BTCUSD position, attach a stop-loss at 68000 and a take-profit at
75000 — dry run first.edit_bracket_order
Edit the bracket (TP/SL) params on an existing entry order.
Auth: Trading key + trade mode
| Param | Type | Required | Notes |
|---|---|---|---|
id | int | yes | entry-order id whose bracket to update |
product_id | int | no | pass exactly one of product_id / product_symbol |
product_symbol | string | no | e.g. BTCUSD |
bracket_stop_loss_price | string | no | stop-loss trigger price |
bracket_stop_loss_limit_price | string | no | stop-loss limit price |
bracket_take_profit_price | string | no | take-profit trigger price |
bracket_take_profit_limit_price | string | no | take-profit limit price |
bracket_trail_amount | string | no | trailing-stop amount |
bracket_stop_trigger_method | string | no | mark_price, last_traded_price, spot_price |
dry_run | bool | no | validate + echo the payload without sending |
id is the entry-order id (an order created with bracket_* params via
place_order). It does not accept the leg ids of a position bracket from
place_bracket_order.
On entry order 123456789, raise the take-profit to 76000 — dry run first.set_product_leverage
Set order leverage for a product.
Auth: Trading key + trade mode
| Param | Type | Required | Notes |
|---|---|---|---|
product_id | int | yes | product to set leverage for |
leverage | string | yes | leverage multiplier, e.g. '10' |
dry_run | bool | no | validate + echo the payload without sending |
Set my BTCUSD order leverage to 10x — dry run first.adjust_position_margin
Add or remove isolated margin on a position.
Auth: Trading key + trade mode
| Param | Type | Required | Notes |
|---|---|---|---|
product_id | int | yes | product id of the position |
delta_margin | string | yes | margin to add (positive) or remove (negative), e.g. '5.0' |
dry_run | bool | no | validate + echo the payload without sending |
Add 5 USDT of isolated margin to my BTCUSD position — dry run first.close_all_positions
Close open positions in the scopes you explicitly enable.
Auth: Trading key + trade mode
| Param | Type | Required | Notes |
|---|---|---|---|
close_all_portfolio | bool | no | close cross / portfolio-margined positions (default false) |
close_all_isolated | bool | no | close isolated-margin positions (default false) |
dry_run | bool | no | validate + echo the payload without sending |
Flatten everything in scope
Both flags default to false, so you must opt into a scope — this never broadens
beyond your request. Your user_id is resolved automatically from your profile.
Dry-run it and confirm before sending.
Close all my isolated-margin positions — dry run first, then I'll confirm.configure_auto_topup
Override auto top-up for a single position.
Auth: Trading key + trade mode
| Param | Type | Required | Notes |
|---|---|---|---|
product_id | int | yes | product id of the position |
auto_topup | bool | yes | enable or disable auto top-up for this position |
dry_run | bool | no | validate + echo the payload without sending |
Turn on auto top-up for my BTCUSD position.get_trading_status
Report whether trading mutations are enabled and where the audit log lives. This tool exists only in trade mode.
Auth: Trading key + trade mode
No parameters.
Returns {mode, audit_log_path} (audit_log_path is null if auditing is
disabled). Use it to confirm trade mode is on and to find your audit trail.
Is trading enabled, and where is the Delta MCP audit log?