For the complete documentation index, see llms.txt. This page is also available as Markdown.

Limit Orders

Create, fetch, cancel, and list limit orders.

The Limit layer exposes:

  • POST /limit-orders/limit

  • GET /limit-orders/limit/{limitOrderId}

  • DELETE /limit-orders/limit/{limitOrderId}

  • POST /limit-orders/limit/{limitOrderId}/replace

  • GET /limit-orders/limits


Create limit order

create

Creates a limit order. You can pass an idempotency key via requestConfig.headers to make the request idempotent.

Parameters

  • body (LimitOrderRequest, required): Limit order payload.

    • timeInForce (string, required): e.g. GTC

    • minAmountOut (string, required)

    • fromChain (string, required)

    • toChain (string, required)

    • tokenIn (string, required)

    • tokenOut (string, required)

    • network (string, required)

    • amount (string, required)

    • slippageBps (number, required)

    • recipient (string, required)

  • requestConfig (object, optional): Request options.

    • headers (Record<string, string>, optional): e.g. { 'Idempotency-Key': 'unique-key' }.

Returns

A Promise that resolves to LimitOrderCreateResponse.

  • data.limitOrderId (string): Limit order identifier.

  • data.status (string): Order status.

  • data.expiresAtMs (number): Expiry timestamp.

  • data.minAmountOut (string): Minimum amount out.

  • meta.requestId (string): Request identifier.

  • meta.timestamp (string): Response timestamp.


Get limit order

get

Fetches a single limit order by ID.

Parameters

  • limitOrderId (string, required): Limit order identifier.

Returns

A Promise that resolves to LimitOrderResponse.

  • data.limitOrderId (string): Limit order ID.

  • data.status (string): Order status.

  • data.timeInForce (string): Time in force.

  • data.createdAtMs, data.updatedAtMs, data.expiresAtMs (number): Timestamps.

  • data.minAmountOut (string): Minimum amount out.

  • meta.requestId (string): Request identifier.

  • meta.timestamp (string): Response timestamp.


Cancel limit order

cancel

Cancels a limit order. Optionally send a body with a cancellation reason.

Parameters

  • limitOrderId (string, required): Limit order identifier.

  • body (LimitOrderCancelBody, optional): Optional payload.

    • reason (string, optional): Cancellation reason.

  • Note: Idempotency is handled via headers on the HTTP request path in the API spec.

Returns

A Promise that resolves to LimitOrderCancelResponse.

  • data.limitOrderId (string): Limit order ID.

  • data.status (string): "canceled".

  • meta.requestId (string): Request identifier.

  • meta.timestamp (string): Response timestamp.


Replace limit order

replace

Replaces an open order (POST /limit-orders/limit/{limitOrderId}/replace).

Parameters

  • limitOrderId (string, required)

  • body (LimitOrderReplaceRequest, required): Same shape as LimitOrderRequest.

  • requestConfig (object, optional): e.g. idempotency headers.

Returns

A Promise that resolves to LimitOrderReplaceResponse.

  • data.limitOrderId (string): New order ID.

  • data.status (string): Usually open.

  • data.expiresAtMs (number)

  • data.minAmountOut (string)

  • data.replacesLimitOrderId (string): Original order ID.


List limit orders

list

Lists limit orders for the authenticated owner with optional filters and pagination.

Parameters

  • params (LimitOrdersListParams, optional): Query parameters.

    • limit (number, optional): Max number of orders to return.

    • status (string, optional): Filter by status.

Returns

A Promise that resolves to LimitOrdersListResponse.

  • data.limitOrders (LimitOrderData[]): Array of limit order objects (same shape as get).

  • meta.requestId (string): Request identifier.

  • meta.timestamp (string): Response timestamp.


On HTTP or API-level errors (e.g. 400, 401), the client throws RoutingEngineAPIError. See Error Handling.

Last updated