get_portfolio_diff
Decompose portfolio value changes over a time window, breaking down USD change into price moves, net deposits/withdrawals, and other effects across chains. Get both structured data and a narrative summary.
Instructions
Decompose what changed in the user's portfolio over a time window — the AI version of an account statement. Returns the top-level USD change, broken down by chain and per-asset into: price moves (USD impact of price change on what was held the entire window), net deposits / withdrawals (sum of priced external transfers), and 'other' (the residual — interest accrual, swap legs, MEV, anything not cleanly attributable to price or external flow). Supports wallet (EVM), tronAddress, solanaAddress, bitcoinAddress — at least one required. Window: 24h / 7d / 30d / ytd. Returns BOTH a structured envelope AND a pre-rendered narrative string suitable for verbatim relay (control via format). Distinct from get_portfolio_summary (which gives current state) and get_pnl_summary (which gives the single net-PnL number) — this tool gives narrative decomposition. v1 caveats: history fetcher caps at ~50 items per chain, so very active wallets may under-count flows (response surfaces truncated: true); DeFi-position interest accrual collapses into the otherEffectUsd residual rather than its own bucket; Solana program-interaction txs (Jupiter swaps, MarginFi actions, etc.) are skipped from net-flow accounting (their balance deltas mix swap legs); Bitcoin shows current balance only (no in-window flow accounting yet).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wallet | No | EVM wallet (Ethereum / Arbitrum / Polygon / Base / Optimism). Used to fetch current balances and walk EVM tx history for the window. | |
| tronAddress | No | TRON mainnet base58 address (T-prefix). Folds TRX + TRC-20 balances and TRON history into the diff. | |
| solanaAddress | No | Solana mainnet base58 pubkey. Folds SOL + SPL balances and Solana history into the diff. | |
| bitcoinAddress | No | Bitcoin address (any type). Folds BTC balance + history. Only one BTC address per call in v1. | |
| window | No | Time window for the diff. "24h" / "7d" / "30d" are rolling; "ytd" is calendar-year-to-date (UTC). For periods longer than 30d the underlying history fetcher's per-chain item cap (~50) may truncate flow accounting; the response surfaces `truncated: true` when this happens. | 30d |
| format | No | "structured" returns the JSON envelope only. "narrative" returns only the pre-rendered string. "both" (default) returns both — agents typically use the narrative for verbatim relay and the structured for follow-up questions. | both |