Market Data
Get Order Book Snapshot
Read current depth, last price, and the 24-hour tape
GET
/
orderbooks
/
commodities
/
api
/
order-books
/
{orderBookId}
/
snapshot
curl "https://api.trusset.org/orderbooks/commodities/api/order-books/clx_ob_comm_001/snapshot?levels=10" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/orderbooks/commodities/api/order-books/${orderBookId}/snapshot?levels=10`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
{
"success": true,
"data": {
"orderBook": {
"id": "clx_ob_comm_001",
"tokenAddress": "0xd8f3ba9de5b7b83f66d1a7b1ad96c1a64b811ff9",
"quoteTokenAddress": "0x98ad0ca091552e23c564b41c74282e5343d03e8a",
"name": "Allocated Gold 999.9",
"symbol": "XAUA",
"status": "ACTIVE",
"tokenType": "LIGHT_TOKEN",
"settlementMode": "ON_CHAIN",
"custodyContract": "0xf3dac9cf19da1c95a80de890e200bc86e0c6f2da",
"allowImport": true,
"priceRefEnabled": true,
"makerFeeBps": 2,
"takerFeeBps": 8,
"minOrderSize": "1000000",
"maxOrderSize": null,
"tickSize": "10000"
},
"depth": {
"bids": [{ "price": "2410000000", "quantity": "3000000", "orderCount": 2 }],
"asks": [{ "price": "2415000000", "quantity": "5000000", "orderCount": 3 }]
},
"lastPrice": "2412550000",
"priceReference": {
"price": "2412.55",
"mode": "EXTERNAL_FEED",
"enforcement": "1MIN",
"spreadBps": 100,
"lowerBound": "2388.4245",
"upperBound": "2436.6755",
"lastUpdated": "2025-06-15T11:59:30.000Z"
},
"stats24h": { "volume": "18000000", "trades": 9, "high": "2418000000", "low": "2405000000" },
"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 other books in its fungibility class, all four widen to the whole eligible set, so the depth you see is the depth an order would actually reach.
Depth counts only orders that can be hit:
OPEN or PARTIALLY_FILLED, not past their expiry, and backed by a balance lock. A depth read that fails returns empty sides rather than an error.
Path Parameters
Query Parameters
Response Fields
Show child attributes
Show child attributes
Trading rules that apply to an order right now:
id, tokenAddress, quoteTokenAddress, name, symbol, status, tokenType, settlementMode, custodyContract, allowImport, priceRefEnabled, makerFeeBps, takerFeeBps, minOrderSize, maxOrderSize and tickSize.Live reference state, or
null. Carries price, mode, enforcement, spreadBps, lowerBound, upperBound and lastUpdated.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/commodities/api/order-books/clx_ob_comm_001/snapshot?levels=10" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/orderbooks/commodities/api/order-books/${orderBookId}/snapshot?levels=10`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
{
"success": true,
"data": {
"orderBook": {
"id": "clx_ob_comm_001",
"tokenAddress": "0xd8f3ba9de5b7b83f66d1a7b1ad96c1a64b811ff9",
"quoteTokenAddress": "0x98ad0ca091552e23c564b41c74282e5343d03e8a",
"name": "Allocated Gold 999.9",
"symbol": "XAUA",
"status": "ACTIVE",
"tokenType": "LIGHT_TOKEN",
"settlementMode": "ON_CHAIN",
"custodyContract": "0xf3dac9cf19da1c95a80de890e200bc86e0c6f2da",
"allowImport": true,
"priceRefEnabled": true,
"makerFeeBps": 2,
"takerFeeBps": 8,
"minOrderSize": "1000000",
"maxOrderSize": null,
"tickSize": "10000"
},
"depth": {
"bids": [{ "price": "2410000000", "quantity": "3000000", "orderCount": 2 }],
"asks": [{ "price": "2415000000", "quantity": "5000000", "orderCount": 3 }]
},
"lastPrice": "2412550000",
"priceReference": {
"price": "2412.55",
"mode": "EXTERNAL_FEED",
"enforcement": "1MIN",
"spreadBps": 100,
"lowerBound": "2388.4245",
"upperBound": "2436.6755",
"lastUpdated": "2025-06-15T11:59:30.000Z"
},
"stats24h": { "volume": "18000000", "trades": 9, "high": "2418000000", "low": "2405000000" },
"timestamp": "2025-06-15T12:00:00.000Z"
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
ORDER_BOOK_NOT_FOUND | 404 | No such commodity 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/commodities/api/order-books/clx_ob_comm_001/snapshot?levels=10" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/orderbooks/commodities/api/order-books/${orderBookId}/snapshot?levels=10`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
{
"success": true,
"data": {
"orderBook": {
"id": "clx_ob_comm_001",
"tokenAddress": "0xd8f3ba9de5b7b83f66d1a7b1ad96c1a64b811ff9",
"quoteTokenAddress": "0x98ad0ca091552e23c564b41c74282e5343d03e8a",
"name": "Allocated Gold 999.9",
"symbol": "XAUA",
"status": "ACTIVE",
"tokenType": "LIGHT_TOKEN",
"settlementMode": "ON_CHAIN",
"custodyContract": "0xf3dac9cf19da1c95a80de890e200bc86e0c6f2da",
"allowImport": true,
"priceRefEnabled": true,
"makerFeeBps": 2,
"takerFeeBps": 8,
"minOrderSize": "1000000",
"maxOrderSize": null,
"tickSize": "10000"
},
"depth": {
"bids": [{ "price": "2410000000", "quantity": "3000000", "orderCount": 2 }],
"asks": [{ "price": "2415000000", "quantity": "5000000", "orderCount": 3 }]
},
"lastPrice": "2412550000",
"priceReference": {
"price": "2412.55",
"mode": "EXTERNAL_FEED",
"enforcement": "1MIN",
"spreadBps": 100,
"lowerBound": "2388.4245",
"upperBound": "2436.6755",
"lastUpdated": "2025-06-15T11:59:30.000Z"
},
"stats24h": { "volume": "18000000", "trades": 9, "high": "2418000000", "low": "2405000000" },
"timestamp": "2025-06-15T12:00:00.000Z"
}
}
