Call it
curl https://api.peume.com/v1/call/closed-trades-aggregate \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"address": "your address",
"group_by": "day",
"fill_gaps": false
}
}'const res = await fetch("https://api.peume.com/v1/call/closed-trades-aggregate", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"address": "your address",
"group_by": "day",
"fill_gaps": false
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/closed-trades-aggregate",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"address": "your address",
"group_by": "day",
"fill_gaps": False
}
},
)
print(res.json()["output"])Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: closed-trades-aggregate.
Parameters
addressRequiredstringWallet address: a 0x EVM address or an ENS name (e.g. vitalik.eth). Solana addresses are not supported.
group_bystringDimension to roll up by. day = UTC calendar day (the P&L calendar / equity-curve source); symbol = per market; direction = long vs short; size_bucket = notional-USD tiers; hold_bucket = holding-time tiers. Defaults to "day".
day · symbol · direction · size_bucket · hold_bucket
Example: day
fromstringWindow start, bounds close_time: Unix seconds, an ISO datetime (2026-03-01T12:00:00Z), or a bare date (= midnight UTC). Omit for full history. Example: 2026-03-01.
tostringWindow end, inclusive, bounds close_time: Unix seconds, an ISO datetime, or a bare date — a bare date means the END of that UTC day, so from=X&to=X covers the whole day X. Defaults to now. Example: 2026-03-31.
dexstringMarket scope: main_dex for the native market only, omit to aggregate across ALL markets, or a builder market — one of: xyz, flx, vntl, hyna, km, abcd, cash, para, mkts. NOTE: the omit default differs from /leaderboard, where omitting dex means the native market only.
main_dex · xyz · flx · vntl · hyna · km · abcd · cash · para · mkts
fill_gapsbooleangroup_by=day only: emit a zero row for every no-trade UTC day in the window so the calendar is dense. Requires from (a bounded window); ignored for other group_by values. Defaults to false.
Example: false
