Wallet trade history (onchain)
curl --request GET \
--url https://api.polynode.dev/v2/onchain/wallets/{address}/tradesimport requests
url = "https://api.polynode.dev/v2/onchain/wallets/{address}/trades"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.polynode.dev/v2/onchain/wallets/{address}/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://api.polynode.dev/v2/onchain/wallets/{address}/trades",
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://api.polynode.dev/v2/onchain/wallets/{address}/trades"
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://api.polynode.dev/v2/onchain/wallets/{address}/trades")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.polynode.dev/v2/onchain/wallets/{address}/trades")
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_bodyOnchain V2 (legacy)
Trade History (Wallet)
Complete onchain trade fill history for any wallet. Every fill, every counterparty, every fee.
GET
/
v2
/
onchain
/
wallets
/
{address}
/
trades
Wallet trade history (onchain)
curl --request GET \
--url https://api.polynode.dev/v2/onchain/wallets/{address}/tradesimport requests
url = "https://api.polynode.dev/v2/onchain/wallets/{address}/trades"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.polynode.dev/v2/onchain/wallets/{address}/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://api.polynode.dev/v2/onchain/wallets/{address}/trades",
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://api.polynode.dev/v2/onchain/wallets/{address}/trades"
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://api.polynode.dev/v2/onchain/wallets/{address}/trades")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.polynode.dev/v2/onchain/wallets/{address}/trades")
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_bodyReturns every onchain trade fill for a wallet — both maker and taker sides, every fill, every counterparty, every fee. Pulled directly from onchain settlement data, never misses a fill. Each trade is enriched with market metadata (question, slug, outcome, image).
Default
Each page takes ~1 second regardless of how many trades the wallet has. The loop just keeps running until
When
Both fields are populated on every row, and they answer different questions:
Want the entire wallet’s history in one call? Use Trade History (Wallet) — Bulk (Growth plan and above). Returns up to 250K trades in a single response, no pagination.
Quick start — get the most recent 100 trades
curl "https://api.polynode.dev/v2/onchain/wallets/{address}/trades?limit=100" \
-H "x-api-key: YOUR_KEY"
limit=100, max limit=1000. That’s all most apps need.
Get every trade for the wallet (full history)
To walk the entire history, add?cursor= (empty value) to the first request, then for each next page, copy pagination.cursor from the response back into the URL. Stop when pagination.has_more is false.
Three complete copy-paste scripts that walk an entire wallet:
import requests
API_KEY = "YOUR_KEY"
WALLET = "0xc944d399164b4460a4a79184fc6f419027891e0a"
def get_all_trades(wallet):
cursor = "" # empty string = first page
all_trades = []
while True:
r = requests.get(
f"https://api.polynode.dev/v2/onchain/wallets/{wallet}/trades",
params={"limit": 1000, "cursor": cursor},
headers={"x-api-key": API_KEY},
).json()
all_trades.extend(r["trades"])
if not r["pagination"]["has_more"]:
break
cursor = r["pagination"]["cursor"] # feed this into the next request
return all_trades
trades = get_all_trades(WALLET)
print(f"got {len(trades)} trades")
const API_KEY = "YOUR_KEY";
const WALLET = "0xc944d399164b4460a4a79184fc6f419027891e0a";
async function getAllTrades(wallet) {
let cursor = ""; // empty string = first page
const allTrades = [];
while (true) {
const url = `https://api.polynode.dev/v2/onchain/wallets/${wallet}/trades`
+ `?limit=1000&cursor=${encodeURIComponent(cursor)}`;
const r = await fetch(url, { headers: { "x-api-key": API_KEY } }).then(r => r.json());
allTrades.push(...r.trades);
if (!r.pagination.has_more) break;
cursor = r.pagination.cursor; // feed this into the next request
}
return allTrades;
}
const trades = await getAllTrades(WALLET);
console.log(`got ${trades.length} trades`);
KEY="YOUR_KEY"
WALLET="0xc944d399164b4460a4a79184fc6f419027891e0a"
CURSOR=""
TOTAL=0
while true; do
RESP=$(curl -s "https://api.polynode.dev/v2/onchain/wallets/$WALLET/trades?limit=1000&cursor=$CURSOR" \
-H "x-api-key: $KEY")
COUNT=$(echo "$RESP" | python3 -c "import json,sys;print(json.load(sys.stdin)['count'])")
HAS_MORE=$(echo "$RESP" | python3 -c "import json,sys;print(json.load(sys.stdin)['pagination']['has_more'])")
TOTAL=$((TOTAL + COUNT))
echo "got $COUNT trades, total: $TOTAL"
[ "$HAS_MORE" = "False" ] && break
CURSOR=$(echo "$RESP" | python3 -c "import json,sys;print(json.load(sys.stdin)['pagination']['cursor'])")
done
has_more is false.
Request
GET /v2/onchain/wallets/{address}/trades?limit=100
GET /v2/onchain/wallets/{address}/trades?limit=1000&cursor=<value-from-prior-response>
| Parameter | Type | Location | Description |
|---|---|---|---|
address | string | path | Wallet address (0x-prefixed, 40 hex chars) |
limit | integer | query | Max results per page (default 100, max 1000) |
cursor | string | query | Pass empty string ?cursor= for first page, then echo back pagination.cursor from each response. Required to walk past the first page reliably on heavy wallets. |
offset | integer | query | Alternative to cursor: skip first N. Fast for the first ~25K results then degrades. Use cursor for anything bigger. |
Response
{
"wallet": "0xc944d399164b4460a4a79184fc6f419027891e0a",
"source": "onchain",
"count": 1,
"pagination": {
"limit": 1000,
"has_more": false
},
"trades": [
{
"tx_hash": "0x3611178d615caeab8f1fb32bc6232a32aaf93fc1e2f5bc5c9914ce2ddb9a13c3",
"order_hash": "0x8676e03168a3cbf39bc1c695e9419127605bd070ff26e7cd628b662c363a82b5",
"timestamp": 1777503244,
"maker": "0xc944d399164b4460a4a79184fc6f419027891e0a",
"taker": "0xe111180000d2663c0091e4f400237545b87b996b",
"maker_asset_id": "0",
"taker_asset_id": "110959653450933276250915064669875552310439627880508793089816880777942697720191",
"maker_amount": 4723.199764,
"taker_amount": 4737.412,
"fee": 0,
"side": "maker",
"direction": "BUY",
"market": "US x Iran ceasefire extended by April 22, 2026?",
"slug": "us-x-iran-ceasefire-extended-by-april-22-2026",
"outcome": "No",
"image": "https://polymarket-upload.s3.us-east-2.amazonaws.com/us-x-iran-ceasefire-by-Cgmx3GCuOwjs.jpg"
}
]
}
pagination.has_more is true, the response also includes a pagination.cursor string — pass that as ?cursor=<value> for the next request.
| Field | Type | Description |
|---|---|---|
count | integer | Number of trades in this response |
pagination.has_more | boolean | true if more pages available — keep paginating |
pagination.cursor | string | Pass back as ?cursor=<value> for the next page (only present when has_more is true) |
trades[].tx_hash | string | Transaction hash |
trades[].timestamp | number | Unix timestamp of the fill |
trades[].order_hash | string | Order hash that was filled |
trades[].maker | string | Maker wallet address |
trades[].taker | string | Taker wallet address |
trades[].maker_asset_id | string | Asset the maker provided ("0" = USDC) |
trades[].taker_asset_id | string | Asset the taker provided (CTF token ID) |
trades[].maker_amount | number | Amount maker provided (USDC) |
trades[].taker_amount | number | Amount taker provided (tokens) |
trades[].fee | number | Fee paid on this fill (USDC) |
trades[].side | string | "maker" or "taker" relative to the queried wallet — exchange role on this fill |
trades[].direction | string | "BUY" or "SELL" from the queried wallet’s perspective. BUY = wallet contributed USDC and received outcome tokens. SELL = wallet contributed outcome tokens and received USDC. |
trades[].market | string | Market question |
trades[].slug | string | Market slug |
trades[].outcome | string | Outcome label (e.g. “Yes”, “Up”, “Trump”) |
trades[].image | string | Market image URL |
side vs direction
Both fields are populated on every row, and they answer different questions:
side= was the wallet the maker (resting limit order) or taker (crossing the spread) on this fill?direction= did the wallet BUY outcome shares (gave USDC) or SELL them (received USDC)?
Path Parameters
Wallet address
Query Parameters
Max results (max 1000)
Skip first N results
Cursor pagination. Pass empty string ?cursor= for the first page, then echo back pagination.cursor from each response. Format: <lastTs>:<lastId>. Each page loads at the same speed regardless of depth — recommended over offset for paging beyond ~25K results.
Response
Trade fills

