> For the complete documentation index, see [llms.txt](https://docs.lighter.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lighter.xyz/api/account/pnl.md).

# pnl

Get account PnL chart

```json
{"openapi":"3.0.0","info":{"title":"Lighter API","version":"1.0.0"},"tags":[{"name":"account"}],"servers":[{"url":"https://mainnet.zklighter.elliot.ai","description":"Lighter mainnet"},{"url":"https://testnet.zklighter.elliot.ai","description":"Lighter testnet"},{"url":"https://api.rh.lighter.xyz","description":"Lighter on Robinhood Chain mainnet"},{"url":"https://api.rh-testnet.lighter.xyz","description":"Lighter on Robinhood Chain testnet"}],"paths":{"/api/v1/pnl":{"get":{"summary":"pnl","operationId":"pnl","tags":["account"],"description":"Get account PnL chart","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string"},"description":"Auth token in the Authorization header."},{"name":"by","in":"query","required":true,"schema":{"type":"string","enum":["index"]},"description":"Field used to identify the requested record."},{"name":"value","in":"query","required":true,"schema":{"type":"string"},"description":"Identifier corresponding to the selected by field."},{"name":"resolution","in":"query","required":true,"description":"1h covers the last 10 days; 1d covers data since 2025-01-01 Allowed values: 1h, 1d.","schema":{"type":"string","enum":["1h","1d"]}},{"name":"start_timestamp","in":"query","required":true,"schema":{"type":"integer","format":"int64","minimum":0,"maximum":5000000000000},"description":"Inclusive start of the requested time range, as a Unix timestamp in milliseconds. These history endpoints also accept Unix seconds."},{"name":"end_timestamp","in":"query","required":true,"schema":{"type":"integer","format":"int64","minimum":0,"maximum":5000000000000},"description":"End of the requested time range, as a Unix timestamp in milliseconds. These history endpoints also accept Unix seconds."},{"name":"count_back","in":"query","required":true,"schema":{"type":"integer","format":"int64"},"description":"Backward-window sizing hint when start_timestamp is 0. An explicit start/end range takes precedence; this is not a strict limit on response length."},{"name":"ignore_transfers","in":"query","required":false,"schema":{"type":"boolean","default":false},"description":"Exclude deposits, withdrawals and transfers from the PnL calculation when true."}],"responses":{"200":{"description":"A successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountPnL"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResultCode"}}}}}}}},"components":{"schemas":{"AccountPnL":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"},"resolution":{"type":"string"},"pnl":{"type":"array","items":{"$ref":"#/components/schemas/PnLEntry"}}},"title":"AccountPnL","required":["code","resolution","pnl"]},"PnLEntry":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"trade_pnl":{"type":"number","format":"double"},"inflow":{"type":"number","format":"double"},"outflow":{"type":"number","format":"double"},"pool_pnl":{"type":"number","format":"double"},"pool_inflow":{"type":"number","format":"double"},"pool_outflow":{"type":"number","format":"double"},"pool_total_shares":{"type":"number","format":"double"},"spot_inflow":{"type":"number","format":"double"},"spot_outflow":{"type":"number","format":"double"},"staked_lit":{"type":"number","format":"double"},"staking_inflow":{"type":"number","format":"double"},"staking_outflow":{"type":"number","format":"double"},"staking_pnl":{"type":"number","format":"double"},"trade_spot_pnl":{"type":"number","format":"double"},"volume":{"type":"number","format":"double"}},"title":"PnLEntry","required":["timestamp","trade_pnl","inflow","outflow","pool_pnl","pool_inflow","pool_outflow","pool_total_shares","spot_inflow","spot_outflow","staking_inflow","staking_outflow","staking_pnl","trade_spot_pnl","volume"],"description":"Fields with zero or empty values may be omitted; handle optional properties when decoding responses."},"ResultCode":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}},"title":"ResultCode","required":["code"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.lighter.xyz/api/account/pnl.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
