{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/marginpad-io/json-schema/marginpad-io-balance-schema.json",
  "title": "Balance",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/marginpad-io-openapi.json#/components/schemas/Balance",
  "type": "object",
  "properties": {
    "starting_balance_usd": {
      "type": "number"
    },
    "balance_usd": {
      "type": "number"
    },
    "equity_usd": {
      "type": "number"
    },
    "margin_in_use_usd": {
      "type": "number"
    },
    "free_margin_usd": {
      "type": "number"
    },
    "unrealized_pnl_usd": {
      "type": "number",
      "description": "With margin_enforced on, free_margin_usd is balance minus committed margin - unrealized profit on an open isolated position is not collateral for a new one."
    },
    "margin_enforced": {
      "type": "boolean",
      "description": "Whether this book is a real budget. Set it on GET|POST /api/bot/v2/sim."
    }
  }
}