curl --request GET \
--url https://builder.prod.bedrock.ostium.io/v1/ordersimport requests
url = "https://builder.prod.bedrock.ostium.io/v1/orders"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://builder.prod.bedrock.ostium.io/v1/orders', 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://builder.prod.bedrock.ostium.io/v1/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://builder.prod.bedrock.ostium.io/v1/orders"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://builder.prod.bedrock.ostium.io/v1/orders")
.asString();require 'uri'
require 'net/http'
url = URI("https://builder.prod.bedrock.ostium.io/v1/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"trader": "0x98279066957a9eaf627d33983409a548cf3e2207",
"chainId": 421614,
"since": 0,
"first": 100,
"skip": 0,
"count": 1,
"orders": [
{
"id": "151106",
"trader": "0x98279066957a9eaf627d33983409a548cf3e2207",
"tradeID": "150888",
"orderType": "Limit",
"orderAction": "Liquidation",
"isPending": false,
"isCancelled": false,
"isBuy": true,
"price": 4511.405815742312,
"priceAfterImpact": 4511.405815742312,
"priceImpactP": 0.004830506038704215,
"collateral": 9.4,
"notionalInUsd": 470,
"notionalInUnits": 0.10264007472684976,
"leverage": 50,
"closePercent": 100,
"profitPercent": -73.925212,
"totalProfitPercent": -100,
"amountSentToTrader": 0,
"rolloverFee": 0.124008,
"liquidationFee": 2.327023,
"builderFee": 0,
"executedAt": "1787933300",
"executedTx": "0x7557adb054fb04cbb71833ad344bd7f2e2937ea9ab44b53bce21c885a7af1147",
"pair": {
"id": "5",
"from": "XAU",
"to": "USD"
}
}
]
}{
"error": "Bad Request",
"message": "Validation failed",
"issues": []
}{
"error": "Too Many Requests",
"message": "Rate limit exceeded. Try again in 7s."
}{
"error": "Bad Gateway",
"message": "Failed to reach the Ostium subgraph."
}Order history for a wallet
Everything that has already happened, newest first: fills of every kind and the orders that were cancelled. Pending orders are excluded — they have not happened yet.
Narrowing the log
| Want | Send |
|---|---|
| Fills only | isCancelled=false |
| Cancellations only | isCancelled=true |
| Both | omit isCancelled |
| One kind of event | orderAction=Open |
| The last 7 days | since=<unix seconds> |
orderAction is one of Open, Close, TakeProfit, StopLoss, Liquidation, RemoveCollateral, CloseDayTrade. Bounding by since rather than paging by skip is the better way through a long history — it is indexed on execution time.
Reading a fill
{
"orderAction": "Liquidation",
"price": 4511.41,
"collateral": 9.4,
"leverage": 50,
"closePercent": 100,
"profitPercent": -73.93,
"totalProfitPercent": -100,
"amountSentToTrader": 0,
"liquidationFee": 2.327023,
"pair": { "id": "5", "from": "XAU", "to": "USD" }
}
A liquidated XAU-USD position: the whole position closed, the trader got nothing back, and 2.33 USDC went to the liquidator.
| Field | Means |
|---|---|
closePercent | How much of the position this fill closed — 50 is half, 100 is all |
profitPercent | PnL on this fill, as a percentage |
totalProfitPercent | PnL on the position as a whole; a liquidation reads -100 |
amountSentToTrader | USDC actually returned to the wallet |
priceImpactP | How far the fill moved from mid, as a percentage |
Those four are populated on closing fills; on an Open they are 0. Fee fields (fundingFee, rolloverFee, closeFee, liquidationFee, devFee, vaultFee, oracleFee) are USDC amounts settled by this fill.
Rate limit: 60 requests per 10 seconds per IP. This budget is shared across /v1/pairs, /v1/trades, /v1/limits and GET /v1/orders, not counted per path. Read x-ratelimit-* for the live budget rather than assuming this figure.
curl --request GET \
--url https://builder.prod.bedrock.ostium.io/v1/ordersimport requests
url = "https://builder.prod.bedrock.ostium.io/v1/orders"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://builder.prod.bedrock.ostium.io/v1/orders', 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://builder.prod.bedrock.ostium.io/v1/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://builder.prod.bedrock.ostium.io/v1/orders"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://builder.prod.bedrock.ostium.io/v1/orders")
.asString();require 'uri'
require 'net/http'
url = URI("https://builder.prod.bedrock.ostium.io/v1/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"trader": "0x98279066957a9eaf627d33983409a548cf3e2207",
"chainId": 421614,
"since": 0,
"first": 100,
"skip": 0,
"count": 1,
"orders": [
{
"id": "151106",
"trader": "0x98279066957a9eaf627d33983409a548cf3e2207",
"tradeID": "150888",
"orderType": "Limit",
"orderAction": "Liquidation",
"isPending": false,
"isCancelled": false,
"isBuy": true,
"price": 4511.405815742312,
"priceAfterImpact": 4511.405815742312,
"priceImpactP": 0.004830506038704215,
"collateral": 9.4,
"notionalInUsd": 470,
"notionalInUnits": 0.10264007472684976,
"leverage": 50,
"closePercent": 100,
"profitPercent": -73.925212,
"totalProfitPercent": -100,
"amountSentToTrader": 0,
"rolloverFee": 0.124008,
"liquidationFee": 2.327023,
"builderFee": 0,
"executedAt": "1787933300",
"executedTx": "0x7557adb054fb04cbb71833ad344bd7f2e2937ea9ab44b53bce21c885a7af1147",
"pair": {
"id": "5",
"from": "XAU",
"to": "USD"
}
}
]
}{
"error": "Bad Request",
"message": "Validation failed",
"issues": []
}{
"error": "Too Many Requests",
"message": "Rate limit exceeded. Try again in 7s."
}{
"error": "Bad Gateway",
"message": "Failed to reach the Ostium subgraph."
}Query Parameters
Trader wallet address (0x-prefixed, 40 hex characters)
^0x[a-fA-F0-9]{40}$Chain to read from: 42161 (Arbitrum One) or 421614 (Arbitrum Sepolia)
42161, 421614 Maximum rows to return (1-1000)
1 <= x <= 1000Rows to skip, for paging (0-5000; use since to page deeper)
0 <= x <= 5000Only orders executed at or after this Unix timestamp in seconds
x >= 0Filter by action: Open, Close, TakeProfit, StopLoss, Liquidation, RemoveCollateral
^[A-Za-z]{1,32}$Filter to cancelled orders only, or to fills only. Omit for both
true, false