https://api.paramx.xyz/v1 (devnet: https://api.paramx.xyz/devnet/v1). Formats and error codes are on Conventions and errors.
Exchange and markets
GET /v1/exchange
Addresses and constants for building transactions and signing orders:
packageis the contract version to call;original_packageis what Move types are named by.exchangeis theexchange_object_idevery order signs.- Only the taker pays the fee: on top of the price when buying, out of the proceeds when selling.
GET /v1/instruments
The underlyings and their grids. id is a contract id’s underlying_id. See Instruments.
GET /v1/instruments/{id}/sessions?from=&to=
Open market sessions between from and to (epoch ms; default now to 7 days later; at most 14 days apart), as [start_ms, end_ms], clipped to the range. An always-open instrument (all of today’s crypto) returns always_open: true and the whole range as one session.
GET /v1/instruments/{id}/price
The underlying’s last trade:
GET /v1/contracts/{contract_id}
One tile: its fields, grid, status, and whether it can be traded now (the same check POST /v1/orders makes):
statusisupcoming,active,settlingorsettled.reason, whentradableis false, isTILE_ENDED,MARKET_CLOSEDorUNKNOWN_INSTRUMENT.outcomeisyes(touched) ornoonce settled.
GET /v1/markets?instrument_id=&grid=
Tradable tiles with resting orders, by instrument, then window, then strike:
GET /v1/books?instrument_id=&grid=
Every tradable book of an instrument (optionally one grid), as price levels with each book’s version: the starting state for a whole-instrument book subscription.
GET /v1/books/{contract_id}
The book as price levels, best first. Each level is [unit price, shares]. Prices are rounded to 6 decimals away from the other side (bids down, asks up).
GET /v1/trades?instrument_id=|contract_id=&limit=100
The public tape, newest first, at most 500. Trades are executed onchain, and have no addresses. The WebSocket’s trades channel adds taker_side; this history doesn’t record it.
Accounts
GET /v1/accounts/{address}
trading_pubkey (hex) and cash (USDC) are null if the address has no account.
GET /v1/accounts/{address}/orders
Resting orders, with what a cancel needs to sign:
GET /v1/accounts/{address}/positions
amount is negative for a short. market_value is null when there’s no price to value it at.
GET /v1/accounts/{address}/balance-history?from=&to=&points=300
The account’s value over time: cash plus its open positions at market (a long’s market value; a short’s $1-a-share collateral less its buy-back cost). from and to are Unix ms (default: the last 7 days), and there are about points points, each the last value in its bucket. Deposits and withdrawals come as markers, so their jumps aren’t read as profit or loss. A point is recorded on every cash change, and every 15 minutes while the account holds positions.
GET /v1/accounts/{address}/fills?since=&until=&limit=100
The account’s fills, newest first: every trade it was on either side of, between since (inclusive) and until (exclusive), both Unix ms, at most 500. For reconciling after a restart; live fills come as fill events on the account channel.
intent_id is the account’s own order in the trade. Whether it was the maker or the taker isn’t recorded here; the fill event’s role says.
GET /v1/accounts/{address}/history?limit=25&offset=0
One entry per contract traded, newest first:
opened:longorshort;bought_amount,sold_amount,held_amount,total_cost,sold_proceeds,payoutandrealized_pnl;outcome:open,under_review,won,lostorclosed;next_offset: the offset of the next page, or null if this is the last.
Orders
POST /v1/orders
-
Fields: see the signing spec for what each one means and what
signaturecovers. A buy needstotal_price, a sell needstotal_amount, and a limit order needs both. The signed intent must carry exactly these values, in micro units. -
time_in_force(limit orders; not signed):gtc(the default): whatever doesn’t fill rests untilexpiry;ioc: whatever doesn’t fill right away is dropped;post_only: refused withWOULD_CROSSif it would match anything, so it only ever makes liquidity.
-
client_order_id(optional; 1–64 characters ofA–Z a–z 0–9 _ -; not signed): your own id for the order, unique per account for 7 days. A repeat is refused withDUPLICATE_CLIENT_ORDER_ID, so retrying a request whose response you lost can never place twice. It’s echoed in the response,/orders, andorderandfillevents. -
Self-trades: an order never trades with your own resting order. If matching reaches one, it stops: the order keeps what it has filled, its remainder is cancelled rather than left resting against your order, and
reasonisSELF_TRADE.
statusisfilled,partially_filled,restingorcancelled(aniocor self-trade remainder).order_idis the resting order, or null when nothing rests.reasonsays why an order stopped short, such asSELF_TRADE, or a chain refusal after some fills.
POST /v1/orders/batch
Up to 20 orders, each signed and validated on its own and placed in order. It isn’t atomic: each result is {"ok": true, …response…} or {"ok": false, "error": {"code", "message"}}, in the same order.
POST /v1/orders/cancel
Give intent_id or client_order_id. The signature is over the order’s CancelOrderIntent (cancels). The order leaves the book at once; nothing is recorded onchain. Returns {"intent_id", "order_id", "client_order_id", "status": "cancelled"}.
POST /v1/orders/cancel-all, POST /v1/orders/cancel-batch
These take many orders off the book at once, instantly, with one signed message (bulk cancels) and no chain transaction.
cancel-allcovers every resting order of the account, or one contract’s withcontract_idset.cancel-batchcovers up to 200 orders, byintent_idsorclient_order_ids.expiryis at most 60 seconds away, and eachnonceworks once (NONCE_USED).- Returns
{"cancelled": [{"intent_id", "order_id", "client_order_id"}]}, plus acancelledevent for each order.
Funds
POST /v1/trading-keys, POST /v1/deposits
These submit a gas-sponsored new_trading_key_transfer or new_deposit_transfer transaction, signed by the wallet key. The exchange’s gas sponsor co-signs it and the operator accepts it. The quickstart describes both transactions. Returns {"accepted": true}.
POST /v1/withdrawals
Moves amount USDC of cash to the account’s own Sui address. The signature is over the withdraw message. Returns {"cash"}, the cash left.