Submit an order
Creates an order in the matching engine after validating the user, client tag, instrument, price range, and request signature. `valid_till` must be at least 150 seconds in the future; the order is then matchable for `valid_till - now - valid_till_buffer`. `position_limit_exceeded` means the order would exceed the signed 64-bit outstanding size or effective position for this user and instrument. The nonce remains available for retry after exposure changes.
Creates an order in the matching engine after validating the user, client tag, instrument, price range, and request signature.
valid_till must be at least 150 seconds in the future;
the order is then matchable for valid_till - now - valid_till_buffer.
position_limit_exceeded means the order would exceed the signed 64-bit
outstanding size or effective position for this user and instrument. The
nonce remains available for retry after exposure changes.
application/json- body
Request body for POST /orders.
client_tag must use a current Unix-ms timestamp in its high 64 bits,
zero reserved bits, and a user-unique value in its low 32 bits.
client_tag*stringPacked nonce bound to EIP-712 Order.nonce as uint128.
Renaming or changing layout is signature-breaking.
High 64 bits are a Unix timestamp in milliseconds; next 32 bits are
reserved and must be zero; low 32 bits identify the user's request.
instrument*stringInstrument must belong to the product's currently active cycle.
price*numberLimit price in human dollars, on a two-decimal grid, 0 < price <= 10.
doublequantity*integerOrder size in whole contracts, from 1 through 9223372036854775807.
int640 <= valueside*SideWhich side of the book. Feeds the EIP-712 Order.isBid.
"bid""ask"signature*stringtime_in_force*TimeInForceTime-in-force for an order. Required on every order.
"GTC""IOC"valid_till*integerExpiry as seconds since posix epoch. Must be more than
150 seconds (the venue's valid_till_buffer)
in the future, and at most 7 days.
The order is matchable for valid_till - now - valid_till_buffer
seconds. It then rests unmatchable for the final
150 seconds and is cancelled expired at
valid_till.
int64user*stringOrder submitted
application/json- response
Accepted orders only; rejections arrive as an error envelope, not this shape with blanked fields.
cancel_reason?|Present only when the order terminated at insert time instead of
resting: filled, ioc, self_trade, expired, cancelled.
client_tag*stringClient tag as 0x-prefixed lowercase hex
exchange_ts_micros*integerExchange timestamp in microseconds since the Unix epoch
int64instrument*stringInstrument identifier as 0x-prefixed lowercase hex
curl -X POST 'https://testnet-api.scalar.market/orders' \
-H 'Content-Type: application/json' \
-d '{
"client_tag": "string",
"instrument": "string",
"price": 0.1,
"quantity": 0,
"side": "bid",
"signature": "string",
"time_in_force": "GTC",
"valid_till": 0,
"user": "string"
}'{
"cancel_reason": "string",
"client_tag": "string",
"exchange_ts_micros": 0,
"instrument": "string"
}Read order book depth GET
Returns the current order book depth (bids and asks) for a given instrument. The instrument must reference a known product and parameter index, and refer to the product's currently active cycle. Every response includes a server-generated `x-request-id` for correlating the request with endpoint logs.
Submit a withdrawal POST
Verifies the user's EIP-712 `WithdrawBalance(address signer,uint256 amount,uint128 nonce,uint256 fee)` signature against the configured ScalarProtocol domain before forwarding. The domain uses name `ScalarProtocol`, version `1`, the configured chain ID, and configured protocol address. Rejections include `insufficient_balance` and `duplicate_request`. In-memory duplicate tracking does not provide durable replay protection across service restarts.