Skip to main content
This page covers authentication, posting and refreshing quotes on options and futures, and cancelling. All traffic goes through the gateway at https://api.ocx.global, written below as {API_BASE}. Prices and quantities are JSON strings; quantities are whole contracts.

Authentication

1

Get a nonce

2

Sign in with SIWE

Sign an EIP-4361 message containing the nonce (domain testnet.ocx.global, uri https://testnet.ocx.global, chainId 84532, expiry within 10 minutes) and verify it:
The response sets the astra_session cookie; its value is your session token.
3

Send the token

Send Authorization: Bearer <token> on every request. The session lasts 7 days; sign in again before it expires.
See Authentication for a complete Node example.
Use a dedicated wallet for each bot — each wallet is a separate OCX account with its own positions and margin. API keys created in the app are not yet accepted by the public API.

Options: replace a ladder

POST {API_BASE}/quotes/bulk — Session. (Alias: /options/quotes/bulk.) Submit your bid and ask levels for one option market in one call. With cancelAll (the default), your open orders in that market are cancelled first and the new ladder is then placed — the standard way to re-quote each cycle without leaving stale orders behind.
string
required
The option to quote, e.g. SPX-2026-10-06-7780-P.
array
required
The ladder levels. Each entry: side (buy | sell), price, quantity, and optional clientOrderId.
boolean
Default true: cancel all your open orders in this market before placing the ladder. Set false to add levels without cancelling.
string
Tags this quoting cycle.
The response is { marketId, results: [{ side, response }] }. Each level is placed independently, so check every entry — one level can be rejected (for example for margin or tick size) while others rest.
Option quotes are gtc limit orders and are not post-only. A quote priced through the opposite side of the book executes immediately as a taker. Price every level from a fresh view of the book.
To place a single bid and/or offer, use POST {API_BASE}/quotes:
Dry-run any level first with POST {API_BASE}/options/orders/preview to check margin and fee.

Futures: rest post-only orders

The futures quote routes are reserved for OCX’s designated market maker. Everyone else provides futures liquidity with ordinary limit orders:
  • postOnly: true guarantees you stay the maker: an order that would cross is rejected (POST_ONLY_WOULD_TAKE) instead of executing.
  • Move a resting level with POST {API_BASE}/fut/orders/{id}/amend and a body of { "price": "…" } and/or { "quantity": "…" }. An amend is a cancel and replace, so the order loses queue priority.
  • Prices must sit on the market’s tickSize (for example 0.25 on NDX futures).

Cancel

Pull orders on shutdown, on feed loss, or as a risk kill switch.
POST {API_BASE}/fut/orders/cancel-all — Session. Body {} cancels every open futures order; scope with marketId, clientOrderId, or marginMode.
Cancel one order with POST {API_BASE}/fut/orders/{id}/cancel.
Your kill switch should call both cancel-all endpoints — futures and options orders are cancelled separately. See Best practices.