Trading Performance

GET/gateway/v1/hyperliquid/performance

Returns the connected user's lifetime trading-performance summary — the dashboard header: re-rolled realized performance (win rate, profit factor, gross/net PnL — funding-excluded, net = gross − fees), the live position snapshot, and account value.

This is a lifetime, point-in-time summary: it takes NO `from`/`to` window (use `/hyperliquid/trades` for windowed, paginated closed trades) and carries NO trade list. `account_value` is the live perp clearinghouse equity only — NOT total portfolio; for total equity incl. spot/vault use `/hyperliquid/account` (`total_value_usd`). Sections degrade independently: a failed section is named in `errors[]` and the call still returns 200. A genuinely flat perp account returns `account_value` 0 with no `errors[]`; the field is omitted only when the snapshot section degraded (which also adds an `errors[]` entry) — so detect degradation via `errors[]`, not a 0 value.

Query Parameters

addressstringrequired

Wallet address: a 0x EVM address or an ENS name (e.g. vitalik.eth). Solana addresses are not supported.

dexstring

NOT SUPPORTED on /performance — returns 400 if set. The lifetime summary always spans ALL markets; market scoping lives on /trades/aggregate (dex=...).

Trading Performance
const options = {method: 'GET'};

fetch('https://api.asksurf.ai/gateway/v1/hyperliquid/performance', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
OK
{
  "$schema": "https://example.com/schemas/DataObjectResponseHyperliquidPerformanceView.json",
  "data": {
    "account_value": 123,
    "address": "<string>",
    "errors": [
      {
        "reason": "<string>",
        "section": "<string>"
      }
    ],
    "open_positions": [
      {
        "cum_funding": {
          "all_time": 123,
          "since_change": 123,
          "since_open": 123
        },
        "distance_to_liquidation": 123,
        "entry_price": 123,
        "leverage_type": "<string>",
        "leverage_value": 123,
        "liquidation_price": 123,
        "margin_used": 123,
        "mark_price": 123,
        "max_leverage": 123,
        "position_value": 123,
        "return_on_equity": 123,
        "side": "<string>",
        "size": 123,
        "symbol": "<string>",
        "unrealized_pnl": 123
      }
    ],
    "partial": true,
    "performance": {
      "avg_loss": 123,
      "avg_win": 123,
      "fees": 123,
      "first_trade": 123,
      "gross_pnl": 123,
      "last_trade": 123,
      "losses": 123,
      "net_pnl": 123,
      "profit_factor": 123,
      "scratches": 123,
      "trades": 123,
      "volume_usd": 123,
      "win_rate": 123,
      "wins": 123
    },
    "total_unrealized_pnl": 123,
    "traded_pairs": 123,
    "watermark": 123
  },
  "meta": {
    "cached": true,
    "credits_used": 123,
    "empty_reason": "<string>"
  }
}