Perpetuals: advanced orders

Server-side execution algorithms and trigger structures: TWAP, VWAP, POV, scale, iceberg, pegged, conditional, OCO, bracket, trailing stop and sniper.

Advanced orders are execution algorithms and trigger structures that the exchange runs for you: you submit the intent, a server-side executor slices, watches or arms it, and child orders hit the book on your behalf. They survive client disconnects.

Every type follows the same shape:

POST   /api/v1/perp/orders/{type}        create
GET    /api/v1/perp/orders/{type}        list
DELETE /api/v1/perp/orders/{type}/{id}   cancel
GET    /api/v1/perp/orders/advanced      list every type in one call

{type} is one of twap, vwap, pov, scale, iceberg, oco, bracket, pegged, sniper, conditional, trailing-stop. Each create call costs weight 2 against your rate budget (Rate limits). All of them accept clientOrderId, leverage, positionSide and (where it makes sense) reduceOnly.

Scheduled execution

TWAP — spread a size evenly over a window.

FieldRequiredNotes
market, side, totalSize, durationSeconds✓
intervalSecondsslice cadence
randomizeSecondsjitter each slice to avoid a predictable footprint
slippageToleranceper-slice bound

VWAP — same idea, weighted toward expected volume.

FieldRequiredNotes
market, side, totalSize, endTime✓endTime is UTC ms
startTime, intervalSeconds
useHistoricalProfileweight slices by the market's historical volume curve instead of evenly

POV — participate at a share of market volume.

FieldRequiredNotes
market, side, totalSize, participationRate, maxDurationSeconds✓participationRate is a fraction of observed volume
minSliceSize, maxSliceSize, priceLimitbound each child order

maxDurationSeconds is what stops a POV order from running forever in a market that stops trading — it is required for that reason.

Passive placement

Scale — a ladder of resting orders.

FieldRequiredNotes
market, side, totalSize, numOrders, startPrice, endPrice✓
sizeSkewweight size toward one end of the ladder
postOnly, timeInForce

Iceberg — show a slice, hide the rest.

FieldRequiredNotes
market, side, totalSize, visibleSize, price✓only visibleSize is ever on the book

Pegged — track the book instead of a fixed price.

FieldRequiredNotes
market, side, size, pegType, offset✓offset from the pegged reference
minPrice, maxPricehard bounds the peg may not cross

Always set minPrice / maxPrice on a pegged order. Without them the peg follows the book wherever it goes.

Triggers and exits

Conditional — fire an order when a trigger price prints.

FieldRequiredNotes
market, side, triggerPrice, size✓
orderType, limitPrice, timeInForcemarket or limit on trigger
triggerPriceTypewhich price arms the trigger (mark / last / index)

OCO — two exits, either one cancels the other.

FieldRequiredNotes
market, side, tpTriggerPrice, slTriggerPrice✓
tpLimitPrice, slLimitPrice, tpSize, slSizelimit-priced and partial exits
positionIdbind the pair to a specific position

Bracket — entry plus both exits, submitted as one structure.

FieldRequiredNotes
market, side, size, takeProfitPrice, stopLossPrice✓
entryType, entryPriceomit for a market entry
takeProfitLimitPrice, stopLossLimitPrice, triggerPriceType

Trailing stop — a stop that follows the favourable side.

FieldRequiredNotes
market, side, size✓
callbackRate or callbackDistancetrail by percentage or by absolute price
activationPricedo not start trailing until this prints
useMarketOrder, limitOffsetRate, expiresAt

Sniper — wait for a condition, then take aggressively.

FieldRequiredNotes
market, side, size✓
sniperType, targetPrice, breakoutDirectionwhat to watch for
minDepthQty, minSpreadBpsonly fire into a book worth taking
maxExecutions, cooldownSeconds, validUntilbound how often and how long it may fire

Interaction with TP/SL

Bracket exits and OCO legs are protection on a position, the same slot that POST /perp/positions/{market}/tpsl writes to. Setting position TP/SL while a bracket or OCO is live is refused with POS_TPSL_EXISTS (14005), listing the order ids that hold that protection — send replace: true to cancel them and take over. The protection array on the position shows what is currently armed and which engine owns it.

Failure codes

CodeNumMeaning
ADV_ORDER_NOT_FOUND18001unknown id for that type
ADV_TYPE_NOT_SUPPORTED18002type not enabled on that market
ADV_INVALID_DURATION18003duration outside allowed bounds
ADV_INVALID_INTERVAL18004slice interval incompatible with the duration
ADV_TRIGGER_PRICE18005trigger on the wrong side of the current price
ADV_ALREADY_TRIGGERED / ADV_ALREADY_COMPLETED / ADV_ALREADY_CANCELLED18006–18008terminal state; cancels are no-ops
ADV_MAX_CHILD_ORDERS18009the slicing plan would exceed the child-order ceiling

Did this page help you?