Order Books
Create Order Book
Deploy a new on-chain order book for a token pair
POST
Creates a new on-chain order book that pairs a stock token with a quote token. The order book settles trades through a custody contract on-chain.
Both
tokenAddress and quoteTokenAddress must reference deployed, registered tokens within the instance. The custody contract handles escrow during the settlement lifecycle.
Order books support three matching modes (continuous, periodic auction, and hybrid) and an optional price reference layer that bounds execution prices against an external or manual reference. Both are configured at creation and can be adjusted later with Update Order Book.
Authentication
Requires an instance API key with thetrading service enabled. Pass the key as x-api-key header in the format trusset_{instanceRef}_{secret}.
Request Body
string
required
EVM address of the base token (the asset being traded). Must match
0x[a-fA-F0-9]{40}.string
required
EVM address of the quote token (the currency used for pricing). Must match
0x[a-fA-F0-9]{40}.string
required
Display name of the order book. 1-64 characters.
string
required
Short symbol for the trading pair. 1-16 characters.
string
EVM address of the custody contract for on-chain settlement. If omitted, trades require manual settlement coordination.
string
Minimum order size in base units (wei). Numeric string.
string
Maximum order size in base units (wei). Numeric string. Omit for no upper limit.
string
Minimum price increment in quote token base units. Numeric string.
integer
Fee charged to makers in basis points. 0-1000 (0%-10%).
integer
Fee charged to takers in basis points. 0-1000 (0%-10%).
string
Type of the base token. One of
LIGHT_TOKEN or STOCK_TOKEN. Defaults to LIGHT_TOKEN.string
Reference ID for stock tokens. Required when
tokenType is STOCK_TOKEN. Max 100 characters.string
Identifier of the underlying instrument (for example an ISIN). Exactly 12 alphanumeric characters, matching
[A-Za-z0-9]{12}.boolean
Whether other instances can import this order book for cross-instance trading. Defaults to
false.Trading Mode (Hybrid Order Books)
These fields control the matching engine. Continuous books match orders on arrival; periodic auction books batch orders and clear at fixed intervals; hybrid books switch between the two based on live spread.string
Matching engine mode. One of
CONTINUOUS (default), PERIODIC_AUCTION, or HYBRID.integer
Auction clearing interval in seconds. Applies to
PERIODIC_AUCTION and HYBRID. 30-3600. Nullable.integer
Spread threshold in basis points that switches a
HYBRID book between continuous matching and auction batching. 1-10000. Nullable.boolean
Whether orders left unmatched at the end of an auction roll forward into the next auction.
integer
Maker rebate paid to registered market makers, in basis points. -1000 to 1000 (negative values charge makers). Nullable.
Price Reference
When enabled, the price reference layer bounds order and trade prices to a band around a reference price. Stale or out-of-band conditions can halt the book or reject orders.boolean
Enable price reference enforcement for this order book.
string
Source of the reference price. One of
MANUAL, STOCK_FEED, or EXTERNAL_FEED.string
Feed endpoint to poll when
priceRefMode is EXTERNAL_FEED. Max 2048 characters. Nullable.string
Headers to send with the feed request, as a serialized string (for example a JSON object of header pairs). Max 4096 characters. Nullable.
string
Path used to extract the price from the feed response (for example a JSON path). Max 256 characters. Nullable.
string
How often the reference is refreshed and enforced. One of
EVERY_TRADE, 1MIN, 5MIN, 10MIN, 30MIN, 1HOUR, 6HOUR, 12HOUR, 1DAY.integer
Allowed band around the reference price, in basis points. Orders priced outside the band are rejected. 1-10000. Nullable.
boolean
Halt the order book when the reference price is older than
priceRefStaleTolerance.integer
Maximum age of the reference price before it is considered stale, in seconds. 60-604800. Nullable.
integer
Circuit breaker threshold in basis points. A reference move beyond this bound trips the breaker. 10-10000. Nullable.
