curl --request GET \
--url https://api.mainnet.aptoslabs.com/decibel/api/v1/trades/window \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mainnet.aptoslabs.com/decibel/api/v1/trades/window"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mainnet.aptoslabs.com/decibel/api/v1/trades/window', 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://api.mainnet.aptoslabs.com/decibel/api/v1/trades/window",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.mainnet.aptoslabs.com/decibel/api/v1/trades/window"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.mainnet.aptoslabs.com/decibel/api/v1/trades/window")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mainnet.aptoslabs.com/decibel/api/v1/trades/window")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"account": "0x1234567890abcdef1234567890abcdef12345678",
"action": "buy",
"asset_type": "perp",
"client_order_id": "client_order_abc",
"counter_party_account": "0xfedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210",
"fee_amount": 123,
"is_profit": true,
"is_rebate": true,
"market": "0xmarket123456789abcdef",
"order_id": "12345",
"price": 50000.25,
"realized_funding_amount": -15.5,
"realized_pnl_amount": 123,
"size": 100.5,
"source": "OrderFill",
"trade_id": "3647276",
"transaction_unix_ms": 1634567890000,
"transaction_version": 3647276285,
"fee_asset": "<string>"
}
]Get trades in a time window
A perp market’s fills between two timestamps, newest first, optionally only those worth at
least min_notional_usd. The window can be at most 31 days. Both legs of a fill are returned.
curl --request GET \
--url https://api.mainnet.aptoslabs.com/decibel/api/v1/trades/window \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mainnet.aptoslabs.com/decibel/api/v1/trades/window"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mainnet.aptoslabs.com/decibel/api/v1/trades/window', 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://api.mainnet.aptoslabs.com/decibel/api/v1/trades/window",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.mainnet.aptoslabs.com/decibel/api/v1/trades/window"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.mainnet.aptoslabs.com/decibel/api/v1/trades/window")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mainnet.aptoslabs.com/decibel/api/v1/trades/window")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"account": "0x1234567890abcdef1234567890abcdef12345678",
"action": "buy",
"asset_type": "perp",
"client_order_id": "client_order_abc",
"counter_party_account": "0xfedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210",
"fee_amount": 123,
"is_profit": true,
"is_rebate": true,
"market": "0xmarket123456789abcdef",
"order_id": "12345",
"price": 50000.25,
"realized_funding_amount": -15.5,
"realized_pnl_amount": 123,
"size": 100.5,
"source": "OrderFill",
"trade_id": "3647276",
"transaction_unix_ms": 1634567890000,
"transaction_version": 3647276285,
"fee_asset": "<string>"
}
]Authorizations
Bearer token from Geomi. See Authentication for setup instructions.
Query Parameters
Perp market address
Window start, unix ms (inclusive)
Window end, unix ms (inclusive)
Only fills worth at least this many USD
Max fills, newest first
1 <= x <= 1000Response
Fills in the window
User's account address
"0x1234567890abcdef1234567890abcdef12345678"
Trade action type. Perp: position-centric ("OpenLong", "CloseShort", "Net", ...). Spot: side from this row's perspective ("Buy" / "Sell").
"buy"
Which product this trade belongs to ("perp" or "spot"). Responses can mix products; this per-row tag lets clients demux.
perp, spot Client-specified order ID
"client_order_abc"
Counter party account on the other leg of the fill. For liquidation / ADL / delisting fills this is the backstop liquidator. Empty string for pre-V2 historical trades that did not carry counter party on-chain.
"0xfedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210"
Fee paid by this row's account, normalized. Perp: always in the
collateral asset (USDC). Spot: charged in the asset this side
RECEIVED (protocol + builder fee combined); see fee_asset.
Whether trade was profitable
Whether trade received rebate
Market identifier address
"0xmarket123456789abcdef"
Order ID associated with trade
"12345"
Trade price
50000.25
Realized funding amount in USDC
- Negative value: trader PAID funding (e.g., long position with positive funding rate)
- Positive value: trader RECEIVED funding (e.g., short position with positive funding rate)
- Zero: no funding accrued
-15.5
Realized PnL amount
Trade size
100.5
Trade source (e.g., "OrderFill", "MarginCall", "BackStopLiquidation", "ADL", "MarketDelisted")
"OrderFill"
Trade ID
"3647276"
Transaction timestamp in milliseconds
1634567890000
Transaction version
x >= 03647276285
FA metadata address of the asset fee_amount is denominated in.
Spot only (base asset for the buyer, quote for the seller); absent
for perp rows, where the fee is implicitly the collateral asset.

