Skip to main content
Requires authentication.
The Orders resource provides order entry and management capabilities for trading on markets.

Methods

MethodEndpointDescription
create(params)POST /v1/ordersCreate a new order
list(params?)GET /v1/orders/openGet open orders
retrieve(order_id)GET /v1/order/{orderId}Get order by ID
cancel(order_id, params)POST /v1/order/{orderId}/cancelCancel an order
modify(order_id, params)POST /v1/order/{orderId}/modifyModify an order
cancel_all(params?)POST /v1/orders/open/cancelCancel all open orders
preview(params)POST /v1/order/previewPreview order before submission
close_position(params)POST /v1/order/close-positionClose an existing position

create

Create a new order on a market.
order = client.orders.create({
    "marketSlug": "btc-100k-2025",
    "intent": "ORDER_INTENT_BUY_LONG",
    "type": "ORDER_TYPE_LIMIT",
    "price": {"value": "0.55", "currency": "USD"},
    "quantity": 100,
    "tif": "TIME_IN_FORCE_GOOD_TILL_CANCEL",
})

print(f"Order ID: {order['id']}")
print(f"State: {order['state']}")

Parameters

ParameterTypeRequiredDescription
marketSlugstrYesMarket to trade
intentstrYesOrder intent (see below)
typestrYesORDER_TYPE_LIMIT or ORDER_TYPE_MARKET
priceAmountLimit onlyLimit price
quantityintYesNumber of contracts
tifstrYesTime in force (see below)

Order Intent

ValueDescription
ORDER_INTENT_BUY_LONGBuy YES shares
ORDER_INTENT_SELL_LONGSell YES shares
ORDER_INTENT_BUY_SHORTBuy NO shares
ORDER_INTENT_SELL_SHORTSell NO shares

Time in Force

ValueDescription
TIME_IN_FORCE_GOOD_TILL_CANCELRemains active until filled or canceled
TIME_IN_FORCE_GOOD_TILL_DATEExpires at specified time
TIME_IN_FORCE_IMMEDIATE_OR_CANCELFill immediately available quantity, cancel rest
TIME_IN_FORCE_FILL_OR_KILLFill entirely or cancel completely

list

Get all open orders.
orders = client.orders.list()

for order in orders["orders"]:
    print(f"{order['id']}: {order['marketSlug']} - {order['state']}")

cancel

Cancel a specific order.
client.orders.cancel("order-id-123", {
    "marketSlug": "btc-100k-2025"
})

cancel_all

Cancel all open orders, optionally filtered by market.
result = client.orders.cancel_all()
print(f"Canceled: {result['canceledOrderIds']}")

# Or cancel for a specific market
result = client.orders.cancel_all({"marketSlug": "btc-100k-2025"})

preview

Preview an order before submitting. Returns estimated fills and costs.
preview = client.orders.preview({
    "marketSlug": "btc-100k-2025",
    "intent": "ORDER_INTENT_BUY_LONG",
    "type": "ORDER_TYPE_LIMIT",
    "price": {"value": "0.55", "currency": "USD"},
    "quantity": 100,
})

print(f"Estimated Cost: ${preview['estimatedCost']}")

close_position

Close an existing position at market price.
result = client.orders.close_position({
    "marketSlug": "btc-100k-2025",
    "synchronousExecution": True,
})

Slippage Tolerance

For market orders and close position, you can specify slippage tolerance:
result = client.orders.close_position({
    "marketSlug": "btc-100k-2025",
    "slippageTolerance": {
        "currentPrice": {"value": "0.50", "currency": "USD"},
        "ticks": 5
    }
})

Order States

Orders progress through these states:
StateDescription
ORDER_STATE_PENDING_NEWReceived, not yet processed
ORDER_STATE_PARTIALLY_FILLEDPartially executed
ORDER_STATE_FILLEDFully executed
ORDER_STATE_CANCELEDCanceled
ORDER_STATE_REJECTEDRejected by exchange
ORDER_STATE_EXPIREDExpired (GTD orders)
For real-time order updates, use the WebSocket with SUBSCRIPTION_TYPE_ORDER instead of polling.