Show more above through their own endpoints. Each request advances at most five source orders,
with every source cancellation isolated in its own transaction. A 202
response includes progress and Retry-After; repeat the same request until the
operation reports completed.
Chase orders cannot be modified. Cancel the chase and place a replacement with
new offset or cap settings.
Close and protect positions
POST /v1/positions/{position_id}/close derives the closing side, leverage,
margin mode, and reduce-only flag from the current position. It supports market,
limit, and external conditional closes. Omit size for a full close. Provide
client_order_id to reconcile the resulting close order in the same way as a
standard order.
+ POST /v1/positions/{position_id}/reverse flips a position to the other side
+ in one market order, like the Reverse button in the app. Send
+ expected_price and an Idempotency-Key; slippage_tolerance_bps and
+ client_order_id are optional. The server sizes the order at twice the
+ position, so a long of 0.01 becomes a short of 0.01, at the position's
+ leverage and margin mode. If collateral cannot cover the full new side, the
+ new position opens at the largest size it covers. Resting take profit and stop
+ loss orders on the old position are canceled. If the position changes before
+ the order is placed, the request is rejected with position_changed; read the
+ position again and retry with a new key.
To flatten one account, send
POST /v1/accounts/{account_id}/close-all-positions with an
Show more below Idempotency-Key. The server snapshots at most 100 open positions and submits
one reduce-only market close per target, paced through the account's order
cooldown. These closes use the trading terminal's 2.5% maximum-slippage policy.
Each request advances one position and never sleeps through the account
cooldown inside the HTTP action. A 202 response includes current progress and
Retry-After; repeat the same request until the operation reports completed.
The final result contains the submitted order or rejection for every
snapshotted position.
Both account-wide endpoints persist their original target snapshot. A retry
with the same idempotency key resumes unfinished targets or returns the
Show more above "oco_pair_with_operation_index": 0
}
]
}
Send this body to PUT /v1/positions/{position_id}/exit-orders. For MCP, call
replace-position-exit-orders with the same fields plus position_id.
If protective exits already exist, populate expected_orders from the current
working-order snapshot with each exit's order_id, execution_type, price,
and size. Do not send an empty snapshot for an already-protected position.
Use execution_type: "limit" for price-capped protective exits through this
batch endpoint; the ordinary create-order endpoint rejects reduce-only
stop_limit and take_limit requests.
+ Trailing stops
+ A trailing stop is a market stop loss that follows price. Its trigger stays a
+ fixed distance behind the best price the market has reached since the stop
+ was placed, and it only moves in your favor; it never loosens. Give the
+ distance as { "unit": "percent", "value": 1.5 } (1.5%, at most two decimals)
+ or { "unit": "price", "value": 250 } (a fixed amount in the market's quote
+ currency).
+ - To protect a new entry, send stop_loss_trail on POST /v1/orders instead
+ of stop_loss_price. It works on opening market, limit, stop, and take
+ entries. The stop is placed when the entry fills, starting from the fill
+ price.
+ - To protect a position you already hold, add trail to a place operation
+ with group: "sl" in PUT /v1/positions/{position_id}/exit-orders. The
+ stop starts from the current market price, so price is only your
+ estimate.
+ json theme={null}
+ {
+ "expected_position_size": 0.01,
+ "expected_orders": [],
+ "operations": [
+ {
+ "kind": "place",
+ "group": "sl",
+ "execution_type": "market",
+ "price": 113000,
+ "size": 0.01,
+ "trail": { "unit": "percent", "value": 1.5 }
+ }
+ ]
+ }
+ The distance must be between 0.10% and 20% of the starting price. An
+ account can have at most 2 active trailing stops, counting trailing legs
+ still waiting on an unfilled entry. Requests past either limit are rejected
+ with rule_violation and rule trailing-stop-distance or
+ max-trailing-stops. Trailing stops cannot be modified; cancel one and place
+ a new one.
+ On orders, trail holds the distance of a trailing stop and trigger_price
+ holds its current level, so read it again rather than caching it. When you
+ list a trailing stop in expected_orders, its price is not compared,
+ because it can move between your read and your request. An entry with a
+ waiting trailing leg reports it as attached_stop_loss_trail.
TWAP and VWAP
Create both strategies with POST /v1/twap-orders. Set strategy to twap
Show more below or vwap, then provide the duration, slice interval, and optional randomized
timing. Optional trigger and termination prices use the same behavior as the
terminal.
The slice interval must be a whole number from 30 seconds through the smaller
of 12 hours or half the selected duration. Every schedule therefore has at
least two slices.
Read active schedules with GET /v1/twap-orders?account_id=..., inspect one
parent with GET /v1/twap-orders/{id}, and stop future slices with DELETE on
that resource. An in-flight child may still settle after cancellation begins.
Retain the parent ID returned at creation to inspect that schedule directly