GET /api/v2/pnl
Auth X-Hub-Key from API_HUB_KEYExecute
GET /run/lighter/api/v2/pnlCache cached 1s, never served stale past that windowCost free · weight 0 · standard rate classSource billing freeV2 public historical PnL series with trade, pool, and staking PnL breakdown summary.
Parameters
| name | in | type | description | |
|---|---|---|---|---|
by | query | strindex | l1_address | required | Lookup key ('index' or 'l1_address'). example: index |
value | query | str | required | Account index or L1 address. example: 281474976710654 |
resolution | query | str1m | 5m | 15m | 1h | 4h | 12h | 1d | 1w | required | Series resolution. example: 1h |
start_timestamp | query | int | required | Start Unix timestamp in seconds. example: 1795796508 |
end_timestamp | query | int | required | End Unix timestamp in seconds. example: 1795882908 |
count_back | query | int | required | Number of data points. example: 5 |
Response
type: object
data key: pnl
pagination: none
sample: {
"code": "int",
"resolution": "str",
"summary": "object",
"pnl": "array[24]"
}
Safe request
Reads the credential from API_HUB_KEY; it never appears in the URL.
curl -sH "X-Hub-Key: $API_HUB_KEY" "https://openapihub.dev/run/lighter/api/v2/pnl?by=index&value=281474976710654&resolution=1h&start_timestamp=1795796508&end_timestamp=1795882908&count_back=5"