{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/marginpad-io/json-schema/marginpad-io-account-schema.json",
  "title": "Account",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/marginpad-io-openapi.json#/components/schemas/Account",
  "type": "object",
  "properties": {
    "open_positions": {
      "type": "integer"
    },
    "margin_in_use_usd": {
      "type": "number"
    },
    "unrealized_pnl_usd": {
      "type": "number"
    },
    "realized_pnl_usd": {
      "type": "number",
      "description": "LIFETIME, not the last 100 trades."
    },
    "closed_trades": {
      "type": "integer"
    },
    "wins": {
      "type": "integer"
    },
    "losses": {
      "type": "integer"
    },
    "win_rate_pct": {
      "type": [
        "number",
        "null"
      ]
    },
    "starting_balance_usd": {
      "type": "number"
    },
    "balance_usd": {
      "type": "number"
    },
    "equity_usd": {
      "type": "number"
    },
    "free_margin_usd": {
      "type": "number"
    },
    "return_pct": {
      "type": "number"
    },
    "best_trade_usd": {
      "type": [
        "number",
        "null"
      ]
    },
    "margin_enforced": {
      "type": "boolean",
      "description": "Always false: the balance is a scorecard, opens are never rejected for lack of funds."
    }
  }
}