{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/kalshispy-com/json-schema/kalshispy-com-live-market-schema.json",
  "title": "LiveMarket",
  "x-generated": "2026-11-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/kalshispy-com-openapi.json#/components/schemas/LiveMarket",
  "type": "object",
  "properties": {
    "ticker": {
      "type": "string"
    },
    "event_ticker": {
      "type": "string"
    },
    "series_ticker": {
      "type": "string"
    },
    "question": {
      "type": "string"
    },
    "outcome": {
      "type": "string"
    },
    "category": {
      "type": "string"
    },
    "category_key": {
      "type": "string",
      "enum": [
        "politics",
        "elections",
        "sports",
        "entertainment",
        "economics",
        "financials",
        "crypto",
        "weather",
        "world",
        "scitech",
        "companies",
        "health",
        "social",
        "transportation",
        "mentions",
        "exotics",
        "other"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "open",
        "settled"
      ]
    },
    "closes_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "closes_in": {
      "type": "string",
      "description": "Compact label such as \"5h\" or \"2d\"."
    },
    "yes_price_cents": {
      "type": "integer",
      "description": "The price to buy YES now (the ask), rounded up to whole cents within 1–99; 0 while nobody offers it or the quote is unavailable. Same for NO."
    },
    "no_price_cents": {
      "type": "integer"
    },
    "consensus_side": {
      "type": "string",
      "enum": [
        "YES",
        "NO"
      ]
    },
    "consensus_pct": {
      "type": "number"
    },
    "whale_count": {
      "type": "integer"
    },
    "yes_count": {
      "type": "integer"
    },
    "no_count": {
      "type": "integer"
    },
    "whale_flow_usd": {
      "type": [
        "number",
        "null"
      ]
    },
    "traders_lifetime_pnl_usd": {
      "type": "number"
    },
    "realized_profit_usd": {
      "type": [
        "number",
        "null"
      ]
    },
    "whales": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/WhalePosition"
      }
    },
    "urls": {
      "type": "object",
      "properties": {
        "kalshi": {
          "type": "string",
          "format": "uri"
        },
        "kalshispy": {
          "type": "string",
          "format": "uri"
        }
      }
    }
  },
  "$defs": {
    "WhalePosition": {
      "type": "object",
      "properties": {
        "nickname": {
          "type": "string"
        },
        "side": {
          "type": "string",
          "enum": [
            "YES",
            "NO"
          ]
        },
        "position_value_usd": {
          "type": "number"
        },
        "market_pnl_usd": {
          "type": "number"
        },
        "cost_usd": {
          "type": "number"
        },
        "lifetime_pnl_usd": {
          "type": "number",
          "description": "Lifetime realized P&L in USD. 0 when it is not positive or not available."
        },
        "roi_pct": {
          "type": [
            "number",
            "null"
          ],
          "description": "Lifetime realized P&L ÷ dollars traded, in percent (40.1 means +40.1%), matching how kalshi.com reports profit and volume. null when no dollar volume is available."
        },
        "markets_traded": {
          "type": "integer"
        },
        "top_category": {
          "type": [
            "string",
            "null"
          ]
        },
        "placed_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    }
  }
}