Get trades in a time window
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>"
}
]Market Data
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.
GET
/
api
/
v1
/
trades
/
window
Get trades in a time window
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
Response
Fills in the window
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.
Example:
"0xfedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210"

