Skip to main content
curl --request GET \
  --url https://api.longshot.xyz/v1/portfolio/pnl \
  --header 'Authorization: Bearer <session_token>'
{
  "events": [
    {
      "source": "position",
      "resolved_at_ms": 1735430100000,
      "position_id": "550e8400-e29b-41d4-a716-446655440000",
      "contest_id": null,
      "pnl_micros": "250000",
      "cumulative_micros": "1250000"
    }
  ]
}
curl --request GET \
  --url https://api.longshot.xyz/v1/portfolio/pnl \
  --header 'Authorization: Bearer <session_token>'
{
  "events": [
    {
      "source": "position",
      "resolved_at_ms": 1735430100000,
      "position_id": "550e8400-e29b-41d4-a716-446655440000",
      "contest_id": null,
      "pnl_micros": "250000",
      "cumulative_micros": "1250000"
    }
  ]
}

Endpoint

GET https://api.longshot.xyz/v1/portfolio/pnl
Authorization: Bearer <session_token>

Headers

Authorization
string
required
Bearer <session_token> from wallet auth or Privy session auth.

Query Parameters

from
int64
Start timestamp as Unix milliseconds, inclusive.
to
int64
End timestamp as Unix milliseconds, inclusive. When both from and to are supplied, from must be less than or equal to to.

Response Fields

events
array
Ordered PNL events for charting.
events[].source
string
Event source: position or fantasy.
events[].resolved_at_ms
int64
Event resolution timestamp as Unix milliseconds.
events[].position_id
string | null
Position ID for position PNL events, otherwise null.
events[].contest_id
string | null
Contest ID when the PNL event comes from a contest, otherwise null.
events[].pnl_micros
string
Realized PNL from this event in micros, encoded as a decimal integer string.
events[].cumulative_micros
string
Cumulative realized PNL after this event in micros, encoded as a decimal integer string.