Skip to main content
GET
/
v3
/
wallets
/
{address}
/
pnl
/
events
Wallet P&L time series
curl --request GET \
  --url https://api.polynode.dev/v3/wallets/{address}/pnl/events \
  --header 'x-api-key: <api-key>'

Documentation Index

Fetch the complete documentation index at: https://docs.polynode.dev/llms.txt

Use this file to discover all available pages before exploring further.

Returns wallet P&L buckets for charting. With period, after, or before, each row is a fixed time window (hour, day, week, or month). A running cumulative_pnl is included so the response can be plotted directly. Without an explicit time filter, the endpoint returns a single all-time summary bucket that matches GET /v3/wallets/{address}/pnl. In event-series mode, wins, losses, and events count realized P&L events in the selected window. In default summary mode, counts are position counts and the response includes count_type: "positions" and summary_bucket: true. Rows at timestamp 0 or earlier are ignored in event-series mode, so explicit event windows start at Unix second 1.

Request

GET /v3/wallets/{address}/pnl/events

Query parameters

ParameterTypeDefaultDescription
groupstringdayBucket size: hour, day, week, month
periodstringShortcut for after: 1d, 7d, 30d, 1y
afterinteger1Start timestamp (Unix seconds, inclusive). Values below 1 are treated as 1.
beforeintegernowEnd timestamp (Unix seconds, inclusive)
limitinteger5000Max buckets returned, clamped 1-10000
If after and period are both set, after wins.

Examples

All-time summary bucket

curl "https://api.polynode.dev/v3/wallets/0xbddf61af533ff524d27154e589d2d7a81510c684/pnl/events"
{
  "address": "0xbddf61af533ff524d27154e589d2d7a81510c684",
  "granularity": "day",
  "bucket_count": 1,
  "buckets": [
    {
      "bucket": 1779908613,
      "realized_pnl": 29035964.931344,
      "cumulative_pnl": 29035964.931344,
      "gross_profit": 29818047.886063,
      "gross_loss": -782082.954719,
      "wins": 482,
      "losses": 33,
      "events": 1016,
      "position_count": 1016,
      "open_positions": 511,
      "unrealized_pnl": -26917534.501466,
      "total_pnl": 2118430.429878,
      "total_volume": 177203290.120101
    }
  ],
  "total_realized_pnl": 29035964.931344,
  "total_events": 1016,
  "total_wins": 482,
  "total_losses": 33,
  "total_positions": 1016,
  "open_positions": 511,
  "unrealized_pnl": -26917534.501466,
  "total_pnl": 2118430.429878,
  "source": "wallet_summary",
  "count_type": "positions",
  "summary_bucket": true,
  "elapsed_ms": 3
}

Daily P&L for the last 7 days

curl "https://api.polynode.dev/v3/wallets/0x44c1dfe43260c94ed4f1d00de2e1f80fb113ebc1/pnl/events?period=7d&group=day"
{
  "address": "0x44c1dfe43260c94ed4f1d00de2e1f80fb113ebc1",
  "granularity": "day",
  "after": 1778478745,
  "before": 1779083545,
  "bucket_count": 3,
  "buckets": [
    {
      "bucket": 1778889600,
      "realized_pnl": 0.000525,
      "cumulative_pnl": 0.000525,
      "gross_profit": 0.000525,
      "gross_loss": 0,
      "wins": 1,
      "losses": 0,
      "events": 1
    },
    {
      "bucket": 1778976000,
      "realized_pnl": 611.069702,
      "cumulative_pnl": 611.070227,
      "gross_profit": 618.41811,
      "gross_loss": -7.348408,
      "wins": 23,
      "losses": 3,
      "events": 26
    },
    {
      "bucket": 1779062400,
      "realized_pnl": 11.774724,
      "cumulative_pnl": 622.844951,
      "gross_profit": 11.774724,
      "gross_loss": 0,
      "wins": 2,
      "losses": 0,
      "events": 2
    }
  ],
  "total_realized_pnl": 622.844951,
  "total_events": 29,
  "total_wins": 26,
  "total_losses": 3,
  "source": "realized_pnl_series",
  "elapsed_ms": 4
}

Hourly P&L for an explicit window

curl "https://api.polynode.dev/v3/wallets/0x44c1dfe43260c94ed4f1d00de2e1f80fb113ebc1/pnl/events?after=1778976000&before=1779062400&group=hour"

Weekly P&L for the last year

curl "https://api.polynode.dev/v3/wallets/0x44c1dfe43260c94ed4f1d00de2e1f80fb113ebc1/pnl/events?period=1y&group=week"

Response fields

FieldTypeDescription
addressstringThe wallet address (lowercased)
granularitystringResolved bucket size (hour, day, week, month)
afterintegerStart of the window (Unix seconds, inclusive)
beforeintegerEnd of the window (Unix seconds, inclusive)
bucket_countintegerNumber of buckets returned
bucketsarrayTime-series rows, ordered oldest → newest
buckets[].bucketintegerBucket start timestamp (Unix seconds, UTC, truncated to bucket boundary)
buckets[].realized_pnlnumberRealized P&L in that bucket (USD)
buckets[].cumulative_pnlnumberRunning sum of realized_pnl over the returned series (USD)
buckets[].gross_profitnumberSum of winning events in that bucket (USD)
buckets[].gross_lossnumberSum of losing events in that bucket (USD, negative)
buckets[].winsintegerCount of winning events in that bucket
buckets[].lossesintegerCount of losing events in that bucket
buckets[].eventsintegerTotal P&L events in event-series mode; position count in default summary mode
buckets[].position_countintegerPosition count. Present in default summary mode.
buckets[].open_positionsintegerOpen position count. Present in default summary mode.
buckets[].unrealized_pnlnumberCurrent unrealized P&L. Present in default summary mode.
buckets[].total_pnlnumberrealized_pnl + unrealized_pnl. Present in default summary mode.
buckets[].total_volumenumberWallet volume from the summary source. Present in default summary mode.
total_realized_pnlnumberSum of realized_pnl across all returned buckets (USD)
total_eventsintegerSum of events across all returned buckets
total_winsintegerSum of wins across all returned buckets
total_lossesintegerSum of losses across all returned buckets
sourcestringDataset label
count_typestringpositions in default summary mode
summary_bucketbooleantrue in default summary mode
elapsed_msintegerServer-side query time in milliseconds

Errors

HTTPWhen
400Invalid wallet address (must be 0x + 40 hex)
400Invalid group value (must be hour, day, week, or month)
400after greater than before

Authorizations

x-api-key
string
header
required

Path Parameters

address
string
required

Wallet address

Query Parameters

group
enum<string>
default:day

Bucket size

Available options:
hour,
day,
week,
month
period
enum<string>

Time window shortcut

Available options:
1d,
7d,
30d,
1y
after
integer
default:1

Unix timestamp lower bound. Values below 1 are clamped to 1.

before
integer

Unix timestamp upper bound

limit
integer
default:5000

Maximum bucket count

Response

Wallet P&L buckets