get_pnl
Calculate profit and loss per asset using average-cost method, comparing cost basis to market price. Include unrealized and realized P&L for fully sold positions when local trade data is available.
Instructions
Profit & loss per asset, using the average-cost method. Walks every asset's trade history to derive an average cost basis, then compares to the latest market price. Returns per-position cost basis, market value, unrealized + realized P&L, plus portfolio totals.
Source priority: locally-imported transactions (via import_transactions) are preferred when available — these include Quick Buy/Sell, Convert, staking and rebate activity that the live API does not expose. When local data is present every traded asset is scanned, so fully-sold positions show their realized P&L too. Without local data, falls back to the live /trades endpoint and only assets with a current non-zero balance are visible.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_pnl"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| quote | No |