REST API — Orders

The HTTP shapes behind the order surface. The TypeScript SDK maps 1:1 onto these operations and signs venue actions locally — it does not call a base URL.

All size, price, fee, and PnL amounts are decimal strings, never JSON numbers — parse with a decimal library (dnum, decimal.js). POST /v1/orders is idempotent on (user, venue, clientOrderId).


POST/v1/orders

Place an order

Submit a single order. Re-using a live clientOrderId returns the original response (idempotent), so a retry can't double the order.

Request body

  • Name
    venue
    Type
    string
    Description
    hl or decibel.
  • Name
    market
    Type
    string
    Description
    BTC (HL) or BTC/USD (Decibel).
  • Name
    side
    Type
    string
    Description
    buy or sell.
  • Name
    size
    Type
    string
    Description
    Positive decimal string.
  • Name
    price
    Type
    string
    Description
    Limit price. Omit for IOC market-style.
  • Name
    tif
    Type
    string
    Description
    gtc | ioc | alo.
  • Name
    reduceOnly
    Type
    boolean
    Description
    Optional.
  • Name
    clientOrderId
    Type
    string
    Description
    Mandatory dedup key. 0x + 32 hex on HL; any non-empty string on Decibel.
  • Name
    tpTriggerPrice
    Type
    string
    Description
    Decibel only — TP attached to this entry.
  • Name
    slTriggerPrice
    Type
    string
    Description
    Decibel only — SL attached to this entry.

Request

POST
/v1/orders
await client.placeOrder({
  venue: 'hl',
  market: 'BTC',
  side: 'buy',
  size: '0.0003',
  price: '50000',
  tif: 'gtc',
  clientOrderId: '0x...',
})

Response — OrderStatus

{
  "orderId": "12345",
  "clientOrderId": "0x...",
  "venue": "hl",
  "market": "BTC",
  "side": "buy",
  "size": "0.0003",
  "price": "50000",
  "tif": "gtc",
  "filled": "0",
  "remaining": "0.0003",
  "state": "open",
  "createdAt": 1779503000000
}

GET/v1/orders

List open orders

Working orders, optionally filtered to one market.

Query

  • Name
    venue
    Type
    string
    Description
    Required.
  • Name
    market
    Type
    string
    Description
    Optional filter.

SDK

await client.openOrders({ venue: 'hl', market: 'BTC' })
// → OrderStatus[]

DELETE/v1/orders

Cancel an order

Cancel by clientOrderId (DELETE /v1/orders) or by orderId (DELETE /v1/orders/{orderId}). Idempotent — a second cancel returns { status: "not_found" }, not an error.

SDK

await client.cancelOrder({ venue: 'hl', clientOrderId: '0x...' })
// → { status: "cancelled" | "not_found" }

GET/v1/orders/{orderId}

Order status

Single-order lookup by venue order id.

SDK

await client.orderStatus({ venue: 'hl', orderId: '12345' })
// → OrderStatus

POST/v1/orders/cancel-all

Cancel all

Bulk cancel, optionally filtered to one market. Returns a per-order breakdown.

SDK

await client.cancelAllOrders({ venue: 'decibel', market: 'BTC/USD' })
// → { cancelled, failed, failures: [...] }

POST/v1/orders/batch

Batch

Up to 20 orders in one action. Each result row is an OrderStatus (success) or a TriaError (per-order rejection — siblings still apply). HL is atomic at the matcher; Decibel runs parallel txs.

SDK

await client.placeBatch({ venue: 'hl', orders: [/* up to 20 */] })
// → Array<OrderStatus | TriaError>

Was this page helpful?