Skip to main content
This guide takes you from zero to your first order. You will read public market data (no credentials), sign in with your wallet, check your balance, and place a trade on a dated future. All requests go through the API gateway at https://api.ocx.global, written here as {BASE_URL}.
Prices and sizes are decimal strings. Send and parse them as strings to keep full precision. Quantities are whole contracts.

1. Read public market data

No authentication is needed for market data. List the futures markets, then pull a book snapshot and stats for one of them. Market ids change as contracts expire — always read them from the market list.
Each market entry carries its contractSize, tickSize, expiry, and current markPrice. Book levels are objects:
For live values, subscribe to the SSE stream {BASE_URL}/fut/book-stream?marketId=NDX-USDC-2026-12-18 instead of polling — it pushes a snapshot, then the book again each time it changes.

2. Sign in with your wallet

Open a session with SIWE: request a nonce, sign the message in your wallet, then verify. See Authentication for the required message fields and a full example.
The -c cookies.txt jar now holds your session cookie; pass -b cookies.txt on authenticated calls (or send the token as Authorization: Bearer <token>).

3. Check your balance

Deposit USDC through the OCX app; deposits are credited to your wallet balance once confirmed on-chain.
perpsBalance is your futures collateral and optionsBalance your options collateral. You do not have to move funds before trading: if an order is rejected only for lack of collateral, OCX moves the shortfall from your wallet and retries once. To allocate explicitly, use POST /wallet/transfer — see Balances & transfers.

4. Preview, then place your first order

Always dry-run first. preview returns the notional, the estimated fee, and whether the order passes the margin check — with no side effects.
Limit prices must sit on the market’s tickSize. clientOrderId makes a retry safe: resending the same order with the same id returns the original result. postOnly keeps you on the maker side (the order is rejected if it would take liquidity), and reduceOnly prevents an order from increasing your position.

5. Watch your orders, positions, and fills

To exit, cancel resting orders or close the position:

Next steps

Authentication

Session tokens for bots and agents.

Methodology

How futures marks and the option board are built.

REST API

Every market-data, trading, account, and wallet endpoint.

Products

Contract sizes, ticks, expiry, and settlement.