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. BothDocumentation Index
Fetch the complete documentation index at: https://docs.trusset.org/llms.txt
Use this file to discover all available pages before exploring further.
tokenAddress and quoteTokenAddress must reference deployed, registered tokens within the instance. The custody contract handles escrow during the settlement lifecycle.
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
EVM address of the base token (the asset being traded). Must match
0x[a-fA-F0-9]{40}.EVM address of the quote token (the currency used for pricing). Must match
0x[a-fA-F0-9]{40}.Display name of the order book. 1-64 characters.
Short symbol for the trading pair. 1-16 characters.
EVM address of the custody contract for on-chain settlement. If omitted, trades require manual settlement coordination.
Minimum order size in base units (wei). Numeric string.
Maximum order size in base units (wei). Numeric string. Omit for no upper limit.
Minimum price increment in quote token base units. Numeric string.
Fee charged to makers in basis points. 0-1000 (0%-10%).
Fee charged to takers in basis points. 0-1000 (0%-10%).
Type of the base token. One of
LIGHT_TOKEN or STOCK_TOKEN. Defaults to LIGHT_TOKEN.Reference ID for stock tokens. Required when
tokenType is STOCK_TOKEN. Max 100 characters.Whether other instances can import this order book for cross-instance trading. Defaults to
false.Error Codes
| Code | Status | Description |
|---|---|---|
ORDER_BOOK_EXISTS | 409 | An order book for this token pair already exists |
INVALID_CONFIG | 400 | Invalid order book configuration |
INVALID_PAIR | 400 | Invalid token pair (e.g. same token for both sides) |
TOKEN_NOT_REGISTERED | 400 | One or both tokens are not registered in this instance |
VALIDATION_ERROR | 400 | Request body failed schema validation |
