Profit and loss, daily value history, results per pair
get_performanceMeasure how the portfolio performed, in one of three views. pnl: TRUE profit and loss over period with the user's own deposits and withdrawals stripped out: realized vs unrealized, net flows, income, fees, top gainers and losers, and a plain-English explanation. history: the daily series over period, oldest first: total value, net capital in, cost basis and cash in and out per UTC day. realized_by_pair: all-time realized FIFO profit ranked by trading pair, best first. Arguments apply per view, and a call that sets one its view does not take is refused: period (pnl, history; omit for all time); slim (history: true drops the per-asset breakdown, recommended unless composition is needed); limit and quote (realized_by_pair: the limit best AND limit worst pairs quoted in quote, defaults 20 and USDT, never summed across quote currencies). All values are USD end-of-day marks, not live quotes: never report pnl.endValue as the current value (get_portfolio has it). A history longer than 200 days is sampled evenly, always keeping the first and the latest day, and says so in truncated; pick a shorter period for every day. For buy and sell totals use get_trading_activity; for single trades use get_movements.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slim | No | history only. true returns the daily totals alone; false or omitted adds a USD value and a quantity for every asset on every day. | |
| view | Yes | Which view to read: pnl (true profit and loss over period); history (daily value series over period); realized_by_pair (all-time realized profit per trading pair). Each view takes only the arguments the description lists for it. | |
| limit | No | realized_by_pair only. How many best AND how many worst pairs to return, 1-100; up to twice this many rows come back. Defaults to 20. | |
| quote | No | realized_by_pair only. Quote currency whose pairs to rank, e.g. "USDT" for BTCUSDT. Defaults to USDT. | |
| period | No | Time window ending now: last_24h, last_7d, last_30d, last_90d, ytd (since 1 January UTC) or all. Omit for all time. | |
| profile | No | Which portfolio to read, for accounts with more than one: its id, or its name (exact, case-insensitive, e.g. "Trading"). Omit to read this connection's default portfolio; every answer names the portfolio it read in `profile`. An unknown or shared name returns profile_not_found or profile_ambiguous listing the real ones, and list_profiles shows them up front. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pnl | No | Present when view = "pnl". | |
| view | No | Which view answered; its data is under the key of the same name. | |
| error | No | Present ONLY when the call was refused instead of answered: upgrade_required (Pro plan needed), not_found, profile_not_found, profile_ambiguous, invalid_arguments, write_not_permitted. No data fields come with it; read `message` to the user rather than retrying the same call. | |
| history | No | Present when view = "history". | |
| message | No | Plain-language explanation that accompanies `error` or a proposed change. | |
| profile | No | The portfolio these figures belong to (absent on list_profiles). | |
| source_url | No | Link to the page in the WhereItGoes app that shows this data. | |
| upgrade_url | No | Where the user can upgrade, on an upgrade_required refusal. | |
| stock_assets | No | Present when the answer mentions Binance Stocks shares (EQ_<ticker>): they are US stocks, not crypto. | |
| realized_by_pair | No | Present when view = "realized_by_pair". |