Market Data
Get Order Book Snapshot
Read current depth, last price, and the 24-hour tape
GET
/
orderbooks
/
stocks
/
api
/
order-books
/
{orderBookId}
/
snapshot
curl "https://api.trusset.org/orderbooks/stocks/api/order-books/clx_ob_stock_002/snapshot?levels=10" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/orderbooks/stocks/api/order-books/${orderBookId}/snapshot?levels=10`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
const bestBid = data.depth.bids[0]?.price ?? null;
const bestAsk = data.depth.asks[0]?.price ?? null;
console.log({ bestBid, bestAsk, last: data.lastPrice });
{
"success": true,
"data": {
"orderBook": {
"id": "clx_ob_stock_002",
"tokenAddress": "0xabc7f1093d5e26b804a1c3f78de025916b47c0d3",
"quoteTokenAddress": "0x98ad0ca091552e23c564b41c74282e5343d03e8a",
"name": "Nyala Fund I",
"symbol": "NYF1",
"status": "ACTIVE",
"tokenType": "STOCK_TOKEN",
"settlementMode": "OFF_CHAIN",
"custodyContract": null,
"allowImport": false,
"priceRefEnabled": true,
"makerFeeBps": 5,
"takerFeeBps": 15,
"minOrderSize": "1000000",
"maxOrderSize": null,
"tickSize": "10000"
},
"depth": {
"bids": [
{ "price": "182350000", "quantity": "4000000", "orderCount": 2 },
{ "price": "182100000", "quantity": "9000000", "orderCount": 3 }
],
"asks": [
{ "price": "182600000", "quantity": "2500000", "orderCount": 1 }
]
},
"lastPrice": "182350000",
"priceReference": {
"price": "182.35",
"mode": "STOCK_FEED",
"enforcement": "5MIN",
"spreadBps": 200,
"lowerBound": "178.703",
"upperBound": "185.997",
"lastUpdated": "2025-06-15T11:58:00.000Z"
},
"stats24h": {
"volume": "31000000",
"trades": 12,
"high": "183100000",
"low": "181200000"
},
"timestamp": "2025-06-15T12:00:00.000Z"
}
}
Returns a point-in-time view of one book: aggregated depth on both sides, the last traded price, the live price reference where one is configured, and rolling 24-hour statistics.
When the book pools depth with peers, all four widen to the whole eligible set, so the depth you see is the depth an order would actually reach. See Shared liquidity.
Depth counts only orders that can actually be hit:
OPEN or PARTIALLY_FILLED, not past their expiry, and on an on-chain book backed by a balance lock. A depth read that fails returns empty sides rather than an error, so always check whether bids and asks are populated before pricing against them.
Path Parameters
string
required
Order book ID.
Query Parameters
integer
default:"20"
Price levels per side, capped at 100.
Response Fields
object
Show child attributes
Show child attributes
object
Trading rules that apply to an order right now.
Show child attributes
Show child attributes
string
Order book ID.
string
Base token.
string
Quote token.
string
Display name.
string
Display symbol.
string
ACTIVE, PAUSED or CLOSED.string
STOCK_TOKEN.string
OFF_CHAIN or ON_CHAIN.string
Custody contract, or
null.boolean
Whether the book is published for import.
boolean
Whether the band is enforced.
integer
Maker fee in basis points.
integer
Taker fee in basis points.
string
Minimum quantity.
string
Maximum quantity, or
null.string
Price increment.
object
string
Price of the most recent trade in order book units, or
null.object
Live reference state, or
null when no reference is enabled or none could be read.Show child attributes
Show child attributes
string
Reference price as a plain decimal.
string
MANUAL, STOCK_FEED or EXTERNAL_FEED.string
Refresh interval.
integer
Band half-width in basis points.
string
Lowest accepted price as a plain decimal, or
null without a spread.string
Highest accepted price as a plain decimal, or
null without a spread.string
ISO 8601 timestamp, or
null.object
string
When the snapshot was taken.
Trades whose settlement failed permanently are excluded from
lastPrice and stats24h. A refused settlement moved nothing and was reversed, so counting it would misstate the tape.curl "https://api.trusset.org/orderbooks/stocks/api/order-books/clx_ob_stock_002/snapshot?levels=10" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/orderbooks/stocks/api/order-books/${orderBookId}/snapshot?levels=10`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
const bestBid = data.depth.bids[0]?.price ?? null;
const bestAsk = data.depth.asks[0]?.price ?? null;
console.log({ bestBid, bestAsk, last: data.lastPrice });
{
"success": true,
"data": {
"orderBook": {
"id": "clx_ob_stock_002",
"tokenAddress": "0xabc7f1093d5e26b804a1c3f78de025916b47c0d3",
"quoteTokenAddress": "0x98ad0ca091552e23c564b41c74282e5343d03e8a",
"name": "Nyala Fund I",
"symbol": "NYF1",
"status": "ACTIVE",
"tokenType": "STOCK_TOKEN",
"settlementMode": "OFF_CHAIN",
"custodyContract": null,
"allowImport": false,
"priceRefEnabled": true,
"makerFeeBps": 5,
"takerFeeBps": 15,
"minOrderSize": "1000000",
"maxOrderSize": null,
"tickSize": "10000"
},
"depth": {
"bids": [
{ "price": "182350000", "quantity": "4000000", "orderCount": 2 },
{ "price": "182100000", "quantity": "9000000", "orderCount": 3 }
],
"asks": [
{ "price": "182600000", "quantity": "2500000", "orderCount": 1 }
]
},
"lastPrice": "182350000",
"priceReference": {
"price": "182.35",
"mode": "STOCK_FEED",
"enforcement": "5MIN",
"spreadBps": 200,
"lowerBound": "178.703",
"upperBound": "185.997",
"lastUpdated": "2025-06-15T11:58:00.000Z"
},
"stats24h": {
"volume": "31000000",
"trades": 12,
"high": "183100000",
"low": "181200000"
},
"timestamp": "2025-06-15T12:00:00.000Z"
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
ORDER_BOOK_NOT_FOUND | 404 | No such stock book on this instance, and not imported |
SERVICE_NOT_ENABLED | 403 | The Trading service is not enabled on this instance |
⌘I
curl "https://api.trusset.org/orderbooks/stocks/api/order-books/clx_ob_stock_002/snapshot?levels=10" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/orderbooks/stocks/api/order-books/${orderBookId}/snapshot?levels=10`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
const bestBid = data.depth.bids[0]?.price ?? null;
const bestAsk = data.depth.asks[0]?.price ?? null;
console.log({ bestBid, bestAsk, last: data.lastPrice });
{
"success": true,
"data": {
"orderBook": {
"id": "clx_ob_stock_002",
"tokenAddress": "0xabc7f1093d5e26b804a1c3f78de025916b47c0d3",
"quoteTokenAddress": "0x98ad0ca091552e23c564b41c74282e5343d03e8a",
"name": "Nyala Fund I",
"symbol": "NYF1",
"status": "ACTIVE",
"tokenType": "STOCK_TOKEN",
"settlementMode": "OFF_CHAIN",
"custodyContract": null,
"allowImport": false,
"priceRefEnabled": true,
"makerFeeBps": 5,
"takerFeeBps": 15,
"minOrderSize": "1000000",
"maxOrderSize": null,
"tickSize": "10000"
},
"depth": {
"bids": [
{ "price": "182350000", "quantity": "4000000", "orderCount": 2 },
{ "price": "182100000", "quantity": "9000000", "orderCount": 3 }
],
"asks": [
{ "price": "182600000", "quantity": "2500000", "orderCount": 1 }
]
},
"lastPrice": "182350000",
"priceReference": {
"price": "182.35",
"mode": "STOCK_FEED",
"enforcement": "5MIN",
"spreadBps": 200,
"lowerBound": "178.703",
"upperBound": "185.997",
"lastUpdated": "2025-06-15T11:58:00.000Z"
},
"stats24h": {
"volume": "31000000",
"trades": 12,
"high": "183100000",
"low": "181200000"
},
"timestamp": "2025-06-15T12:00:00.000Z"
}
}
