OstiumBuilder Service
API ReferenceHTTP APIExchange Operations

Exchange: Cancel

Cancel limit orders or market timeouts.

Alpha Version

The Ostium Builder Service is in Alpha. API endpoints, specifications, and builder URLs may change without notice. Use with caution in production environments.

POST /v1/exchange/cancel

Builds unsigned transactions to cancel pending limit orders or cancel stuck market orders (timeouts).

Headers

HeaderRequiredDescription
X-Trader-AddressYesTrader wallet address.
X-API-KeyNoDelegated mode (delegate wallet must be verified).
Content-TypeYesapplication/json or text/plain (JSON string).

Request Body

FieldTypeRequiredDescription
cancelsCancelItem[]YesOne or more cancel actions.

CancelItem

FieldTypeRequiredDescription
tstringYesCancel type: limit, open, close.
anumberCond.Pair index (required for limit).
inumberCond.Order index (required for limit).
onumberCond.Order ID (required for open or close timeouts).

Constraints

  • cancels must contain at least one item.
  • limit cancels require a and i.
  • open or close cancels require o (order ID).
  • Delegated mode supports one cancel per request.

Response Body (unsigned)

FieldTypeRequiredDescription
transactionsUnsignedTransaction[]YesOne or more unsigned transactions.

Response Body (delegated)

FieldTypeRequiredDescription
txHashstringYesTransaction hash of the delegated action.
smartAccountAddressstringYesSmart account used for delegation.

Example Request

curl -X POST https://builder.ostiscan.xyz/v1/exchange/cancel \
  -H "Content-Type: application/json" \
  -H "X-Trader-Address: 0xYourWallet" \
  -d '{"cancels":[{"t":"limit","a":0,"i":1}]}'

Response (200, unsigned)

{
  "transactions": [
    { "to": "0x...", "data": "0x...", "value": "0", "from": "0xYourWallet" }
  ]
}

Response (200, delegated)

{
  "txHash": "0x...",
  "smartAccountAddress": "0x..."
}

Errors

See /docs/errors.

On this page