Price Reference
Get Price Reference
Read the current reference price and the band it implies
GET
/
orderbooks
/
commodities
/
api
/
order-books
/
{orderBookId}
/
price-reference
curl "https://api.trusset.org/orderbooks/commodities/api/order-books/clx_ob_comm_001/price-reference" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/orderbooks/commodities/api/order-books/${orderBookId}/price-reference`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
{
"success": true,
"data": {
"enabled": true,
"mode": "EXTERNAL_FEED",
"enforcement": "1MIN",
"spreadBps": 100,
"haltOnStale": true,
"staleTolerance": 300,
"currentPrice": "2412.55",
"lowerBound": "2388.4245",
"upperBound": "2436.6755",
"lastUpdated": "2025-06-15T11:59:30.000Z"
}
}
Returns the book’s reference configuration together with the live price and the band derived from it. The price is resolved the same way an incoming order would resolve it: from cache if the enforcement interval has not elapsed, otherwise from the configured source.
A book with the reference disabled returns its configuration with
currentPrice, lowerBound and upperBound all null. So does a book whose feed could not be reached. This read is deliberately forgiving, so a monitoring call does not fail because a feed blinked. Submit Order takes the stricter view and can refuse with PRICE_REF_STALE.
Path Parameters
string
required
Order book ID.
Response Fields
object
Show child attributes
Show child attributes
boolean
Whether the band is enforced on incoming orders.
string
MANUAL, STOCK_FEED or EXTERNAL_FEED.string
Refresh interval, from
EVERY_TRADE to 1DAY.integer
Band half-width in basis points, or
null if no band is enforced.boolean
Whether a stale reference stops trading.
integer
Staleness window in seconds, or
null for the derived default.string
Live reference price as a plain decimal, or
null.string
Lowest accepted price as a plain decimal, or
null.string
Highest accepted price as a plain decimal, or
null.string
When the stored reference was last written, or
null.Bounds are decimals in the quote currency. An order’s
price is an order book unit integer, so divide it by 1000000 before comparing it against lowerBound and upperBound.curl "https://api.trusset.org/orderbooks/commodities/api/order-books/clx_ob_comm_001/price-reference" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/orderbooks/commodities/api/order-books/${orderBookId}/price-reference`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
{
"success": true,
"data": {
"enabled": true,
"mode": "EXTERNAL_FEED",
"enforcement": "1MIN",
"spreadBps": 100,
"haltOnStale": true,
"staleTolerance": 300,
"currentPrice": "2412.55",
"lowerBound": "2388.4245",
"upperBound": "2436.6755",
"lastUpdated": "2025-06-15T11:59:30.000Z"
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
INVALID_PARAM | 400 | orderBookId is missing or longer than 100 characters |
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/price-reference" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/orderbooks/commodities/api/order-books/${orderBookId}/price-reference`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
{
"success": true,
"data": {
"enabled": true,
"mode": "EXTERNAL_FEED",
"enforcement": "1MIN",
"spreadBps": 100,
"haltOnStale": true,
"staleTolerance": 300,
"currentPrice": "2412.55",
"lowerBound": "2388.4245",
"upperBound": "2436.6755",
"lastUpdated": "2025-06-15T11:59:30.000Z"
}
}
