Market data is public, the order lifecycle is a handful of JSON endpoints, and futures executions arrive on a Server-Sent Events stream. If you can write an HTTP client and sign a message with a wallet key, you can write an OCX agent.
The agent loop
Every OCX agent, from a simple signal follower to a market-making bot, reduces to the same cycle. Keep it tight and idempotent.1
Read
Pull markets, order books, stats, candles, and the option board — or subscribe to the streams — to build your current view.
2
Decide
Turn that view into an intent: an order to place, a quote ladder to refresh, or a position to reduce.
3
Act
Preview to size safely, then place or cancel. Use a
clientOrderId so retries never double-submit.4
Monitor
Consume the futures account stream and poll option fills to detect executions and position changes.
5
Manage risk
Track NLV and margin headroom, de-risk proactively, and wire both cancel-alls to your kill switch.
What your agent talks to
Market data (public)
Futures markets, order books, 24h stats, candles, fee schedules, and the option board. No credentials required.
Trading (session)
Preview, place, amend, and cancel futures and option orders; replace option quote ladders in one call; flatten futures positions.
Real-time streams (SSE)
Futures books, your futures fills and positions, the option board, and your balances.
Account reads
Positions, open orders, fills, balances, NLV, and margin — for reconciliation between stream events.
Programmatic authentication
The agent signs in with Sign-In With Ethereum using a wallet key it controls, then sends the resulting session token asAuthorization: Bearer <token> on every request. The session lasts 7 days; the agent re-signs before it expires.
testnet.ocx.global, uri https://testnet.ocx.global, chainId 84532, the nonce, and an expiry no more than 10 minutes out. A complete Node example is in Authentication.
API keys created in the app are not yet accepted by the public API, so agents authenticate with a session token.
Pricing your agent should understand
Your agent consumes prices and marks; it does not recompute the exchange’s internals.Futures marks
Futures marks
Each dated future is marked to the live price of the matching contract on the reference market; trades on OCX do not move the mark. Futures have a fixed expiry and cash-settle — there is no funding. See Futures methodology.
Option marks
Option marks
Option
mark on the board follows the reference option market; iv and delta are computed by OCX with Black-76 against each expiry’s forward. They are reference values — the tradable prices are always the order book. See Options methodology.Contract terms
Contract terms
Quantities are whole contracts. A futures notional is quantity ×
contractSize × price; an option premium is price × quantity × multiplier (50 for SPX, 20 for NDX). Read terms from /fut/markets and /markets/products.Risk is enforced server-side
OCX runs portfolio margin across options and futures: every order passes a margin check before acceptance, and a rejected order returnsINSUFFICIENT_MARGIN — handle it, don’t retry blindly. Accounts whose margin requirement exceeds their net liquidation value are reduced, and accounts at the liquidation floor are liquidated, with an insurance fund absorbing bad debt. Your agent should track its own headroom from GET /portfolio/balances and de-risk before it gets there.
Next step
Build an agent
A concrete walkthrough: sign in, pull market data, size an order, submit it, monitor fills on the stream, and manage risk — with code.