Off-Chain Settlement
Set Off-Chain Price Reference
Publish a manual reference price from the off-chain surface
POST
/
orderbooks
/
stocks
/
api
/
offchain
/
order-books
/
{orderBookId}
/
price-reference
curl -X POST "https://api.trusset.org/orderbooks/stocks/api/offchain/order-books/clx_ob_stock_001/price-reference" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "price": "182.35" }'
const res = await fetch(
`https://api.trusset.org/orderbooks/stocks/api/offchain/order-books/${orderBookId}/price-reference`,
{
method: 'POST',
headers: {
'X-API-Key': 'trusset_your_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({ price: '182.35' })
}
);
const { data } = await res.json();
{
"success": true,
"data": { "price": "182.35", "updatedAt": "2025-06-15T12:00:00.000Z" }
}
Records a reference price on a book you own. Identical in behaviour to Set Price Reference, including the circuit breaker and the band sweep over resting orders.
The book must have
priceRefEnabled set. The route does not assert the settlement mode, so it also works on an on-chain book you own.
Path Parameters
Body Parameters
Reference price as a plain positive decimal, such as
"182.35". Not an order book unit value.Response Fields
curl -X POST "https://api.trusset.org/orderbooks/stocks/api/offchain/order-books/clx_ob_stock_001/price-reference" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "price": "182.35" }'
const res = await fetch(
`https://api.trusset.org/orderbooks/stocks/api/offchain/order-books/${orderBookId}/price-reference`,
{
method: 'POST',
headers: {
'X-API-Key': 'trusset_your_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({ price: '182.35' })
}
);
const { data } = await res.json();
{
"success": true,
"data": { "price": "182.35", "updatedAt": "2025-06-15T12:00:00.000Z" }
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
VALIDATION_ERROR | 400 | price is missing or not a positive decimal string |
INVALID_PARAM | 400 | orderBookId is missing or longer than 100 characters |
INVALID_PRICE | 400 | price parses to zero, a negative number, or a non-finite value |
PRICE_REF_DISABLED | 400 | The book does not have priceRefEnabled set |
ORDER_BOOK_NOT_FOUND | 404 | The book does not exist on your instance |
SERVICE_NOT_ENABLED | 403 | The Trading service is not enabled on this instance |
⌘I
curl -X POST "https://api.trusset.org/orderbooks/stocks/api/offchain/order-books/clx_ob_stock_001/price-reference" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "price": "182.35" }'
const res = await fetch(
`https://api.trusset.org/orderbooks/stocks/api/offchain/order-books/${orderBookId}/price-reference`,
{
method: 'POST',
headers: {
'X-API-Key': 'trusset_your_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({ price: '182.35' })
}
);
const { data } = await res.json();
{
"success": true,
"data": { "price": "182.35", "updatedAt": "2025-06-15T12:00:00.000Z" }
}
