xo-orderbook-client-rs
// Requires an authenticated client.
use xo_orderbook_client::orderbook::types::request::TradesRequest;
let page = client.trades(&TradesRequest::default(), None).await?;
for t in &page.data {
println!("{} {:?} {} @ {}", t.id, t.trader_side, t.size, t.price);
}curl --request GET \
--url https://orderbooks.xo.market/trades \
--header 'XO_API_KEY: <api-key>'import requests
url = "https://orderbooks.xo.market/trades"
headers = {"XO_API_KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {XO_API_KEY: '<api-key>'}};
fetch('https://orderbooks.xo.market/trades', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://orderbooks.xo.market/trades",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"XO_API_KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://orderbooks.xo.market/trades"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("XO_API_KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://orderbooks.xo.market/trades")
.header("XO_API_KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://orderbooks.xo.market/trades")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["XO_API_KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"limit": 100,
"count": 2,
"next_cursor": "LTE=",
"data": [
{
"id": "0xc0ffee0000000000000000000000000000000000000000000000000000000a11",
"market": "0x39a12d52b63969654926e095ddd96f5c459112714da03edca769aa58173c78fb",
"outcome": "Yes",
"side": "BUY",
"price": "0.553",
"size": "15000000",
"status": "CONFIRMED",
"match_time": "1779355812",
"last_update": "1779355820",
"bucket_index": 0,
"transaction_hash": "0xdeadbeef000000000000000000000000000000000000000000000000000000c0",
"taker_order_id": "0xfeed00000000000000000000000000000000000000000000000000000000000a",
"asset_id": "26516164265702901957933644848127860370782874751279270726689263951695181556943",
"fee_rate_bps": "0",
"owner": "346629a1-8226-5a85-823f-3a25ae818e10",
"maker_address": "0xBEEF000000000000000000000000000000000B22",
"trader_side": "TAKER",
"maker_orders": [
{
"order_id": "77",
"maker_address": "0xBEEF000000000000000000000000000000000B22",
"owner": "9c4f0d6b-5a3e-5b8c-9e1d-2f3a4b5c6d7e",
"matched_amount": "15000000",
"price": "0.553",
"fee_rate_bps": "0",
"asset_id": "26516164265702901957933644848127860370782874751279270726689263951695181556943",
"outcome": "Yes"
}
],
"maker_original_size": "50000000",
"maker_remaining_after_fill": "35000000",
"taker_original_size": "15000000",
"taker_remaining_after_fill": "0"
},
{
"id": "0xc0ffee0000000000000000000000000000000000000000000000000000000a12",
"market": "0x39a12d52b63969654926e095ddd96f5c459112714da03edca769aa58173c78fb",
"outcome": "Yes",
"side": "SELL",
"price": "0.550",
"size": "20000000",
"status": "MATCHED",
"match_time": "1779355790",
"last_update": "1779355790",
"bucket_index": 0,
"transaction_hash": null,
"taker_order_id": "0xfeed00000000000000000000000000000000000000000000000000000000000b",
"asset_id": "26516164265702901957933644848127860370782874751279270726689263951695181556943",
"fee_rate_bps": "0",
"owner": "346629a1-8226-5a85-823f-3a25ae818e10",
"maker_address": "0xBEEF000000000000000000000000000000000B22",
"trader_side": "MAKER",
"maker_orders": []
}
]
}Trade
Get trades
Paginated trades visible to the caller. status walks
MATCHED → MINED → CONFIRMED (or RETRYING/FAILED).
transaction_hash is null until the trade settles on-chain.
bucket_index is currently hardcoded to 0 (per-trade buckets
not yet introduced). maker_remaining_after_fill and friends
are absent on pre-PR records — be ready for missing keys.
GET
/
trades
xo-orderbook-client-rs
// Requires an authenticated client.
use xo_orderbook_client::orderbook::types::request::TradesRequest;
let page = client.trades(&TradesRequest::default(), None).await?;
for t in &page.data {
println!("{} {:?} {} @ {}", t.id, t.trader_side, t.size, t.price);
}curl --request GET \
--url https://orderbooks.xo.market/trades \
--header 'XO_API_KEY: <api-key>'import requests
url = "https://orderbooks.xo.market/trades"
headers = {"XO_API_KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {XO_API_KEY: '<api-key>'}};
fetch('https://orderbooks.xo.market/trades', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://orderbooks.xo.market/trades",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"XO_API_KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://orderbooks.xo.market/trades"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("XO_API_KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://orderbooks.xo.market/trades")
.header("XO_API_KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://orderbooks.xo.market/trades")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["XO_API_KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"limit": 100,
"count": 2,
"next_cursor": "LTE=",
"data": [
{
"id": "0xc0ffee0000000000000000000000000000000000000000000000000000000a11",
"market": "0x39a12d52b63969654926e095ddd96f5c459112714da03edca769aa58173c78fb",
"outcome": "Yes",
"side": "BUY",
"price": "0.553",
"size": "15000000",
"status": "CONFIRMED",
"match_time": "1779355812",
"last_update": "1779355820",
"bucket_index": 0,
"transaction_hash": "0xdeadbeef000000000000000000000000000000000000000000000000000000c0",
"taker_order_id": "0xfeed00000000000000000000000000000000000000000000000000000000000a",
"asset_id": "26516164265702901957933644848127860370782874751279270726689263951695181556943",
"fee_rate_bps": "0",
"owner": "346629a1-8226-5a85-823f-3a25ae818e10",
"maker_address": "0xBEEF000000000000000000000000000000000B22",
"trader_side": "TAKER",
"maker_orders": [
{
"order_id": "77",
"maker_address": "0xBEEF000000000000000000000000000000000B22",
"owner": "9c4f0d6b-5a3e-5b8c-9e1d-2f3a4b5c6d7e",
"matched_amount": "15000000",
"price": "0.553",
"fee_rate_bps": "0",
"asset_id": "26516164265702901957933644848127860370782874751279270726689263951695181556943",
"outcome": "Yes"
}
],
"maker_original_size": "50000000",
"maker_remaining_after_fill": "35000000",
"taker_original_size": "15000000",
"taker_remaining_after_fill": "0"
},
{
"id": "0xc0ffee0000000000000000000000000000000000000000000000000000000a12",
"market": "0x39a12d52b63969654926e095ddd96f5c459112714da03edca769aa58173c78fb",
"outcome": "Yes",
"side": "SELL",
"price": "0.550",
"size": "20000000",
"status": "MATCHED",
"match_time": "1779355790",
"last_update": "1779355790",
"bucket_index": 0,
"transaction_hash": null,
"taker_order_id": "0xfeed00000000000000000000000000000000000000000000000000000000000b",
"asset_id": "26516164265702901957933644848127860370782874751279270726689263951695181556943",
"fee_rate_bps": "0",
"owner": "346629a1-8226-5a85-823f-3a25ae818e10",
"maker_address": "0xBEEF000000000000000000000000000000000B22",
"trader_side": "MAKER",
"maker_orders": []
}
]
}Authorizations
L2 HMAC request signature. See Authentication.