> 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/binary-options/portfolio_bopnl.md).

# portfolio\_boPnl

**Lighter only.**

Get binary-options realized PnL for an authenticated account, grouped by event and ordered newest event first. cursor is an exclusive event id; event\_id returns a single event. Every outcome the account has traded is reported, including markets still open or unsettled, so an entry never disappears as the account trades. Per outcome, total\_pnl is all realized PnL so far including settlement, and settlement\_pnl is null until the market settles with a position to settle, then the string 0.000000 for an actual zero-PnL settlement. An event's total\_pnl is the sum of its listed outcomes. Missing display metadata uses zero/empty values.

`total_pnl` is realized PnL **gross of fees**, including settlement. Subtract trading fees separately when calculating net PnL. `settlement_pnl` is `null` until the market settles with a position to settle; a settled zero-PnL position returns `"0.000000"`. Supply an account auth token in the `authorization` header. See [Positions and settlement](https://lighter-1.gitbook.io/all-docs/developers/binary-options/positions-and-settlement) for payout semantics and an example.

```json
{"openapi":"3.0.0","info":{"title":"Lighter API","version":"1.0.0"},"tags":[{"name":"binary-options"}],"servers":[{"url":"https://mainnet.zklighter.elliot.ai","description":"Lighter mainnet"},{"url":"https://testnet.zklighter.elliot.ai","description":"Lighter testnet"}],"paths":{"/api/v1/portfolio/boPnl":{"get":{"summary":"portfolio_boPnl","operationId":"portfolio_boPnl","tags":["binary-options"],"description":"**Lighter only.**\n\nGet binary-options realized PnL for an authenticated account, grouped by event and ordered newest event first. cursor is an exclusive event id; event_id returns a single event. Every outcome the account has traded is reported, including markets still open or unsettled, so an entry never disappears as the account trades. Per outcome, total_pnl is all realized PnL so far including settlement, and settlement_pnl is null until the market settles with a position to settle, then the string 0.000000 for an actual zero-PnL settlement. An event's total_pnl is the sum of its listed outcomes. Missing display metadata uses zero/empty values.\n\n`total_pnl` is realized PnL **gross of fees**, including settlement. Subtract trading fees separately when calculating net PnL. `settlement_pnl` is `null` until the market settles with a position to settle; a settled zero-PnL position returns `\"0.000000\"`. Supply an account auth token in the `authorization` header. See [Positions and settlement](https://lighter-1.gitbook.io/all-docs/developers/binary-options/positions-and-settlement) for payout semantics and an example.","parameters":[{"name":"authorization","in":"header","description":" make required after integ is done","required":false,"schema":{"type":"string"}},{"name":"auth","in":"query","description":"Account auth token, supplied as an alternative to the `authorization` header.","required":false,"schema":{"type":"string"}},{"name":"account_index","in":"query","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"event_id","in":"query","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int64","default":"100","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RespGetBoPnL"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResultCode"}}}}}}}},"components":{"schemas":{"RespGetBoPnL":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"},"events":{"type":"array","items":{"$ref":"#/components/schemas/BoEventPnL"}},"next_cursor":{"type":"integer","format":"int64"}},"title":"RespGetBoPnL","required":["code","events"]},"BoEventPnL":{"type":"object","properties":{"event_id":{"type":"integer","format":"int64"},"event_title":{"type":"string"},"event_description":{"type":"string"},"total_pnl":{"type":"string"},"outcomes":{"type":"array","items":{"$ref":"#/components/schemas/BoOutcomePnL"}}},"title":"BoEventPnL","required":["event_id","event_title","event_description","total_pnl","outcomes"]},"BoOutcomePnL":{"type":"object","properties":{"market_id":{"type":"integer","format":"int64"},"symbol":{"type":"string"},"outcome":{"type":"integer","format":"int32","enum":[0,1,2]},"end_timestamp":{"type":"integer","format":"int64"},"settlement_pnl":{"type":"string","nullable":true},"last_trade_id":{"type":"integer","format":"int64"},"total_pnl":{"type":"string"}},"title":"BoOutcomePnL","required":["market_id","symbol","outcome","end_timestamp","settlement_pnl","last_trade_id","total_pnl"]},"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/binary-options/portfolio_bopnl.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.
