# Pnl

## Get PnL position for a trading address and token

> Returns the materialized cost basis position for chart overlay.\
> \
> \- source: amm | sodax\
> \- avgCostBasis: USD per display token unit\
> \- totalQty: remaining display token quantity\
> \- Returns zeroed fields when no position exists.

```json
{"openapi":"3.0.0","info":{"title":"Radfi API","version":"1.0"},"servers":[{"url":"https://api.bound.exchange","description":"Production"}],"paths":{"/api/pnl/position":{"get":{"operationId":"PnlController_getPosition","summary":"Get PnL position for a trading address and token","description":"Returns the materialized cost basis position for chart overlay.\n\n- source: amm | sodax\n- avgCostBasis: USD per display token unit\n- totalQty: remaining display token quantity\n- Returns zeroed fields when no position exists.","parameters":[{"name":"source","required":true,"in":"query","schema":{"enum":["amm","sodax"],"type":"string"}},{"name":"tokenId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["pnl"]}}}}
```

## Get PnL balances for a trading address

> Returns all non-zero positions with live unrealized PnL for the Balances tab.\
> \
> \- AMM and SODAX positions are returned as separate items (source field).\
> \- unrealizedPnl = (currentPrice − avgCostBasis) × totalQty (USD)\
> \- Fully closed positions (totalQty = 0) are excluded.

```json
{"openapi":"3.0.0","info":{"title":"Radfi API","version":"1.0"},"servers":[{"url":"https://api.bound.exchange","description":"Production"}],"paths":{"/api/pnl/balances":{"get":{"operationId":"PnlController_getPnlBalances","summary":"Get PnL balances for a trading address","description":"Returns all non-zero positions with live unrealized PnL for the Balances tab.\n\n- AMM and SODAX positions are returned as separate items (source field).\n- unrealizedPnl = (currentPrice − avgCostBasis) × totalQty (USD)\n- Fully closed positions (totalQty = 0) are excluded.","parameters":[],"responses":{"200":{"description":""}},"tags":["pnl"]}}}}
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bound-1.gitbook.io/bound-docs/developer-guide/api-reference/pnl.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
