Order Books
Get Shared Peers
List the books this one pools depth with
GET
/
orderbooks
/
stocks
/
api
/
order-books
/
{orderBookId}
/
shared-peers
curl "https://api.trusset.org/orderbooks/stocks/api/order-books/clx_ob_stock_002/shared-peers" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/orderbooks/stocks/api/order-books/${orderBookId}/shared-peers`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
console.log(data.enabled ? `${data.peerCount} peers` : 'pooling off');
{
"success": true,
"data": {
"enabled": true,
"peerCount": 1,
"peerIds": ["clx_ob_stock_044"],
"peers": [
{
"id": "clx_ob_stock_044",
"instanceId": "inst_partner_9",
"name": "Helvetia Growth",
"symbol": "HELG",
"tokenAddress": "0x51f2b9d0e77c4a1b83ce6d4a9271e5f3a0c8b912",
"quoteTokenAddress": "0x98ad0ca091552e23c564b41c74282e5343d03e8a",
"custodyContract": "0x98c33b10823172e62a31d6048773df1054c4f821",
"tokenType": "STOCK_TOKEN",
"status": "ACTIVE",
"underlyingIdentifier": "DE000A0F5UF5",
"cfid": null
}
]
}
}
Returns the books whose depth this book matches against, beyond its own. See Shared liquidity.
A book that has not opted in reports
enabled: false and an empty peer set. A book that has opted in but has no eligible counterpart reports enabled: true with peerCount: 0. The difference matters, because the first is a configuration choice and the second means nothing matched.
Eligibility for a stock book is an exact match on the ISIN recorded on the token, the same quote token, the same custody contract, the same token type, and the same network, with both sides opted in and ACTIVE. The result is cached for 30 seconds and refreshed when a book’s status or pooling flag changes.
Path Parameters
string
required
Order book ID.
Response Fields
object
Show child attributes
Show child attributes
boolean
Whether this book opted into pooling.
integer
Number of eligible peers, excluding this book.
array
Peer order book IDs.
array
Show child attributes
Show child attributes
string
Peer order book ID.
string
Instance that owns the peer.
string
Peer display name.
string
Peer display symbol.
string
Peer base token.
string
Peer quote token.
string
Peer custody contract.
string
Peer token type.
string
Peer status.
string
Instrument identifier the pooling keys on.
string
Commodity fungibility class.
null on stock books.curl "https://api.trusset.org/orderbooks/stocks/api/order-books/clx_ob_stock_002/shared-peers" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/orderbooks/stocks/api/order-books/${orderBookId}/shared-peers`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
console.log(data.enabled ? `${data.peerCount} peers` : 'pooling off');
{
"success": true,
"data": {
"enabled": true,
"peerCount": 1,
"peerIds": ["clx_ob_stock_044"],
"peers": [
{
"id": "clx_ob_stock_044",
"instanceId": "inst_partner_9",
"name": "Helvetia Growth",
"symbol": "HELG",
"tokenAddress": "0x51f2b9d0e77c4a1b83ce6d4a9271e5f3a0c8b912",
"quoteTokenAddress": "0x98ad0ca091552e23c564b41c74282e5343d03e8a",
"custodyContract": "0x98c33b10823172e62a31d6048773df1054c4f821",
"tokenType": "STOCK_TOKEN",
"status": "ACTIVE",
"underlyingIdentifier": "DE000A0F5UF5",
"cfid": null
}
]
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
INVALID_PARAM | 400 | orderBookId is missing or longer than 100 characters |
ORDER_BOOK_NOT_FOUND | 404 | No such 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/shared-peers" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/orderbooks/stocks/api/order-books/${orderBookId}/shared-peers`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
console.log(data.enabled ? `${data.peerCount} peers` : 'pooling off');
{
"success": true,
"data": {
"enabled": true,
"peerCount": 1,
"peerIds": ["clx_ob_stock_044"],
"peers": [
{
"id": "clx_ob_stock_044",
"instanceId": "inst_partner_9",
"name": "Helvetia Growth",
"symbol": "HELG",
"tokenAddress": "0x51f2b9d0e77c4a1b83ce6d4a9271e5f3a0c8b912",
"quoteTokenAddress": "0x98ad0ca091552e23c564b41c74282e5343d03e8a",
"custodyContract": "0x98c33b10823172e62a31d6048773df1054c4f821",
"tokenType": "STOCK_TOKEN",
"status": "ACTIVE",
"underlyingIdentifier": "DE000A0F5UF5",
"cfid": null
}
]
}
}
