Order Books
List Order Books
List the commodity order books your instance owns or has imported
GET
/
orderbooks
/
commodities
/
api
/
order-books
curl "https://api.trusset.org/orderbooks/commodities/api/order-books?status=ACTIVE" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
'https://api.trusset.org/orderbooks/commodities/api/order-books?status=ACTIVE',
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
const byClass = new Map<string, any[]>();
for (const b of data) {
if (!b.cfid) continue;
byClass.set(b.cfid, [...(byClass.get(b.cfid) ?? []), b]);
}
{
"success": true,
"data": [
{
"id": "clx_ob_comm_001",
"instanceId": "inst_abc123",
"tokenAddress": "0xd8f3ba9de5b7b83f66d1a7b1ad96c1a64b811ff9",
"quoteTokenAddress": "0x98ad0ca091552e23c564b41c74282e5343d03e8a",
"name": "Allocated Gold 999.9",
"symbol": "XAUA",
"status": "ACTIVE",
"tokenType": "LIGHT_TOKEN",
"settlementMode": "ON_CHAIN",
"custodyContract": "0xf3dac9cf19da1c95a80de890e200bc86e0c6f2da",
"cfid": "0x6b1f0d2c8a3e57941b6d0af25c8e3714b90d6f2a41c5e807396ba2d5f10c84e7",
"makerFeeBps": 2,
"takerFeeBps": 8,
"allowImport": true,
"allowSharedLiquidity": true,
"tradingMode": "CONTINUOUS",
"createdAt": "2025-06-01T09:00:00.000Z"
},
{
"id": "clx_ob_comm_055",
"instanceId": "inst_partner_9",
"name": "Zurich Vault Gold",
"symbol": "ZVG",
"status": "ACTIVE",
"tokenType": "LIGHT_TOKEN",
"cfid": "0x6b1f0d2c8a3e57941b6d0af25c8e3714b90d6f2a41c5e807396ba2d5f10c84e7",
"_imported": true,
"_importId": "clx_import_031"
}
]
}
Returns every commodity order book on your instance, newest first, followed by every book you have imported from another instance.
Imported books carry two extra fields,
_imported and _importId, which owned books do not have. _importId is what Remove Import takes.
Books sharing a cfid are in the same fungibility class and, where both have opted in, match against one another’s depth.
Query Parameters
string
Restrict to one status:
ACTIVE, PAUSED or CLOSED. Applies to owned and imported books alike.Response Fields
data is an array of order book records, each with the same fields as Get Order Book, plus:
boolean
Present and
true only on imported books.string
Present only on imported books.
curl "https://api.trusset.org/orderbooks/commodities/api/order-books?status=ACTIVE" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
'https://api.trusset.org/orderbooks/commodities/api/order-books?status=ACTIVE',
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
const byClass = new Map<string, any[]>();
for (const b of data) {
if (!b.cfid) continue;
byClass.set(b.cfid, [...(byClass.get(b.cfid) ?? []), b]);
}
{
"success": true,
"data": [
{
"id": "clx_ob_comm_001",
"instanceId": "inst_abc123",
"tokenAddress": "0xd8f3ba9de5b7b83f66d1a7b1ad96c1a64b811ff9",
"quoteTokenAddress": "0x98ad0ca091552e23c564b41c74282e5343d03e8a",
"name": "Allocated Gold 999.9",
"symbol": "XAUA",
"status": "ACTIVE",
"tokenType": "LIGHT_TOKEN",
"settlementMode": "ON_CHAIN",
"custodyContract": "0xf3dac9cf19da1c95a80de890e200bc86e0c6f2da",
"cfid": "0x6b1f0d2c8a3e57941b6d0af25c8e3714b90d6f2a41c5e807396ba2d5f10c84e7",
"makerFeeBps": 2,
"takerFeeBps": 8,
"allowImport": true,
"allowSharedLiquidity": true,
"tradingMode": "CONTINUOUS",
"createdAt": "2025-06-01T09:00:00.000Z"
},
{
"id": "clx_ob_comm_055",
"instanceId": "inst_partner_9",
"name": "Zurich Vault Gold",
"symbol": "ZVG",
"status": "ACTIVE",
"tokenType": "LIGHT_TOKEN",
"cfid": "0x6b1f0d2c8a3e57941b6d0af25c8e3714b90d6f2a41c5e807396ba2d5f10c84e7",
"_imported": true,
"_importId": "clx_import_031"
}
]
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
SERVICE_NOT_ENABLED | 403 | The Trading service is not enabled on this instance |
⌘I
curl "https://api.trusset.org/orderbooks/commodities/api/order-books?status=ACTIVE" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
'https://api.trusset.org/orderbooks/commodities/api/order-books?status=ACTIVE',
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
const byClass = new Map<string, any[]>();
for (const b of data) {
if (!b.cfid) continue;
byClass.set(b.cfid, [...(byClass.get(b.cfid) ?? []), b]);
}
{
"success": true,
"data": [
{
"id": "clx_ob_comm_001",
"instanceId": "inst_abc123",
"tokenAddress": "0xd8f3ba9de5b7b83f66d1a7b1ad96c1a64b811ff9",
"quoteTokenAddress": "0x98ad0ca091552e23c564b41c74282e5343d03e8a",
"name": "Allocated Gold 999.9",
"symbol": "XAUA",
"status": "ACTIVE",
"tokenType": "LIGHT_TOKEN",
"settlementMode": "ON_CHAIN",
"custodyContract": "0xf3dac9cf19da1c95a80de890e200bc86e0c6f2da",
"cfid": "0x6b1f0d2c8a3e57941b6d0af25c8e3714b90d6f2a41c5e807396ba2d5f10c84e7",
"makerFeeBps": 2,
"takerFeeBps": 8,
"allowImport": true,
"allowSharedLiquidity": true,
"tradingMode": "CONTINUOUS",
"createdAt": "2025-06-01T09:00:00.000Z"
},
{
"id": "clx_ob_comm_055",
"instanceId": "inst_partner_9",
"name": "Zurich Vault Gold",
"symbol": "ZVG",
"status": "ACTIVE",
"tokenType": "LIGHT_TOKEN",
"cfid": "0x6b1f0d2c8a3e57941b6d0af25c8e3714b90d6f2a41c5e807396ba2d5f10c84e7",
"_imported": true,
"_importId": "clx_import_031"
}
]
}
