fetch_account_state
Get an authenticated account's portfolio summary and open positions in one coherent read, avoiding mismatched counts, with per-position risk detail.
Instructions
Get the authenticated account's full state in ONE call: the portfolio summary aggregates plus every open position ({ summary, positions }). Prefer this over pairing fetch_account_summary with fetch_positions — both parts come from one coherent read, so summary.open_positions_count always matches the positions length. If the engine-authoritative margin view is unavailable this fails closed with a 502 (authoritative_margin_unavailable) rather than returning an estimate: retry after a short delay, do NOT read the error as a flat or empty account. Positions carry per-position risk detail. notional_value, margin_used, roe, max_leverage, and leverage are derived from mirrored state, so any of them can be null with a companion <field>_error naming the reason (e.g. mark_price_unavailable); treat null as UNKNOWN, never as zero. leverage is currently always null (leverage_error: margin_state_not_mirrored) — do not infer it from margin_used. funding_paid is NOT one of those: it is always present and has no _error companion, so its "0" is a real zero (no funding accrued), not unknown. It is paid-positive — a negative value means funding was received. Requires API credentials.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||