{
 "openapi": "3.1.0",
 "info": {
  "title": "DegenHedge public data API",
  "version": "1.0.0",
  "summary": "Read-only JSON for Kalshi Bitcoin 15-minute markets: the live window, DegenHedge's graded alert record, and Kalshi's taker fee.",
  "description": "Free, read-only, no key, no personal data, CORS open. Rate limit: 60 requests a minute per IP. Human docs: https://degenhedge.com/api/ . MCP (Streamable HTTP): https://degenhedge.com/mcp . Please cite DegenHedge and link https://degenhedge.com/results/ when you quote the record. Informational and entertainment use only; not financial, investment or betting advice. The BTC record sits below the breakeven its average entry price implies: always quote a win rate together with its average entry. 18+. Problem gambling help: 1-800-GAMBLER.",
  "termsOfService": "https://degenhedge.com/terms/",
  "contact": {
   "name": "DegenHedge",
   "url": "https://degenhedge.com/api/",
   "email": "team@degenhedge.com"
  }
 },
 "servers": [
  {
   "url": "https://degenhedge.com"
  }
 ],
 "externalDocs": {
  "description": "API docs",
  "url": "https://degenhedge.com/api/"
 },
 "tags": [
  {
   "name": "market data"
  },
  {
   "name": "record"
  },
  {
   "name": "fees"
  }
 ],
 "paths": {
  "/api/btc-window": {
   "get": {
    "operationId": "getBtcWindow",
    "tags": [
     "market data"
    ],
    "summary": "The Kalshi KXBTC15M window trading now",
    "description": "Ticker, open/close time, official strike (60-second CF Benchmarks BRTI average before the open, or null until Kalshi posts it), Up/Down asks and bids in cents, Kalshi's live fee schedule for the series and a Coinbase spot reference. Kalshi public data only; no prediction. Cached 5 seconds.",
    "responses": {
     "200": {
      "description": "Current window (available=false when Kalshi data is unavailable)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/BtcWindow"
        }
       }
      }
     },
     "429": {
      "description": "Rate limited (60 requests a minute per IP across /api/*; retry after a minute)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/record": {
   "get": {
    "operationId": "getGradedRecord",
    "tags": [
     "record"
    ],
    "summary": "DegenHedge's graded BTC 15-minute alert record, overall and by entry price",
    "description": "Every alert sent to subscribers with a usable 1-99 cent entry, graded against Kalshi's official result, losses included. Overall and per entry-price bucket: n, wins, win rate with a Wilson 95% interval, average entry, breakeven before and after a one-contract fee. Derived from /results.csv (same source as /results/) and tied out against the site's live figures. Cached 5 minutes.",
    "responses": {
     "200": {
      "description": "Graded record",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Record"
        }
       }
      }
     },
     "503": {
      "description": "Temporarily unavailable",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limited (60 requests a minute per IP across /api/*; retry after a minute)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/kalshi-fee": {
   "get": {
    "operationId": "getKalshiFee",
    "tags": [
     "fees"
    ],
    "summary": "Kalshi taker fee, total cost and breakeven for a price and order size",
    "description": "Same arithmetic as https://degenhedge.com/tools/kalshi-fee-calculator/ (exact cent rounding). Price is in CENTS (95 = 95 cents).",
    "parameters": [
     {
      "name": "price",
      "in": "query",
      "required": true,
      "description": "Contract price in cents, 0.1 to 99.9 (whole cents between 10 and 90)",
      "schema": {
       "type": "number",
       "minimum": 0.1,
       "maximum": 99.9
      },
      "example": 95
     },
     {
      "name": "contracts",
      "in": "query",
      "required": false,
      "description": "Number of contracts, 1 to 100000 (default 1)",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100000,
       "default": 1
      },
      "example": 10
     },
     {
      "name": "maker",
      "in": "query",
      "required": false,
      "description": "true for a resting (maker) order; KXBTC15M charges makers no fee",
      "schema": {
       "type": "boolean",
       "default": false
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Fee quote",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/FeeQuote"
        }
       }
      }
     },
     "400": {
      "description": "Invalid price or contracts",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limited (60 requests a minute per IP across /api/*; retry after a minute)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/results.csv": {
   "get": {
    "operationId": "getResultsCsv",
    "tags": [
     "record"
    ],
    "summary": "The full graded log (all products) as CSV",
    "description": "Columns: date_et, product, label, side, model_pct, market_price_cents, outcome (W, L or EXCLUDED), game_id, kalshi_ticker, settled_at, note. Excluded rows are disclosed, never dropped. Cached 5 minutes.",
    "responses": {
     "200": {
      "description": "CSV",
      "content": {
       "text/csv": {
        "schema": {
         "type": "string"
        }
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Record": {
    "type": "object",
    "required": [
     "product",
     "overall",
     "by_entry_price",
     "data_through_et",
     "ties_out_with_stats",
     "results_csv",
     "disclaimer",
     "summary"
    ],
    "properties": {
     "product": {
      "type": "string"
     },
     "unit": {
      "type": "string"
     },
     "overall": {
      "type": "object",
      "required": [
       "signals",
       "wins",
       "losses",
       "win_rate_pct",
       "avg_entry_cents",
       "breakeven_before_fees_pct"
      ],
      "properties": {
       "signals": {
        "type": "integer",
        "description": "Graded alerts counted"
       },
       "wins": {
        "type": "integer"
       },
       "losses": {
        "type": "integer"
       },
       "win_rate_pct": {
        "type": [
         "number",
         "null"
        ],
        "description": "wins / signals x 100"
       },
       "wilson95_lo_pct": {
        "type": [
         "number",
         "null"
        ],
        "description": "Wilson 95% interval, low end"
       },
       "wilson95_hi_pct": {
        "type": [
         "number",
         "null"
        ],
        "description": "Wilson 95% interval, high end"
       },
       "avg_entry_cents": {
        "type": [
         "number",
         "null"
        ],
        "description": "Average whole-cent entry price"
       },
       "breakeven_before_fees_pct": {
        "type": [
         "number",
         "null"
        ],
        "description": "Equals the average entry price: the win rate needed to break even before fees"
       },
       "breakeven_after_1contract_fee_pct": {
        "type": [
         "number",
         "null"
        ],
        "description": "Average of (entry + one-contract taker fee) in cents"
       },
       "win_rate_minus_breakeven_before_fees_pts": {
        "type": [
         "number",
         "null"
        ],
        "description": "Negative = below breakeven"
       },
       "median_entry_cents": {
        "type": [
         "number",
         "null"
        ]
       }
      }
     },
     "summary": {
      "type": "string",
      "description": "One sentence comparing the win rate with its breakeven"
     },
     "by_entry_price": {
      "type": "array",
      "items": {
       "type": "object",
       "required": [
        "bucket",
        "signals",
        "wins",
        "losses",
        "win_rate_pct",
        "avg_entry_cents",
        "breakeven_before_fees_pct"
       ],
       "properties": {
        "bucket": {
         "type": "string",
         "enum": [
          "79c or less",
          "80-85c",
          "86-89c",
          "90-92c",
          "93-94c",
          "95c",
          "96c",
          "97c",
          "98c",
          "99c"
         ]
        },
        "signals": {
         "type": "integer",
         "description": "Graded alerts counted"
        },
        "wins": {
         "type": "integer"
        },
        "losses": {
         "type": "integer"
        },
        "win_rate_pct": {
         "type": [
          "number",
          "null"
         ],
         "description": "wins / signals x 100"
        },
        "wilson95_lo_pct": {
         "type": [
          "number",
          "null"
         ],
         "description": "Wilson 95% interval, low end"
        },
        "wilson95_hi_pct": {
         "type": [
          "number",
          "null"
         ],
         "description": "Wilson 95% interval, high end"
        },
        "avg_entry_cents": {
         "type": [
          "number",
          "null"
         ],
         "description": "Average whole-cent entry price"
        },
        "breakeven_before_fees_pct": {
         "type": [
          "number",
          "null"
         ],
         "description": "Equals the average entry price: the win rate needed to break even before fees"
        },
        "breakeven_after_1contract_fee_pct": {
         "type": [
          "number",
          "null"
         ],
         "description": "Average of (entry + one-contract taker fee) in cents"
        },
        "win_rate_minus_breakeven_before_fees_pts": {
         "type": [
          "number",
          "null"
         ],
         "description": "Negative = below breakeven"
        }
       }
      }
     },
     "excluded_rows_disclosed_in_csv": {
      "type": "integer",
      "description": "BTC rows shown in results.csv but not counted (price capture error, 100c entry, not sent)"
     },
     "first_signal_et": {
      "type": [
       "string",
       "null"
      ]
     },
     "data_through_et": {
      "type": [
       "string",
       "null"
      ]
     },
     "data_through_utc": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "ties_out_with_stats": {
      "type": "boolean",
      "description": "n and wins equal the site's live /stats figures"
     },
     "stats_figures": {
      "type": "object"
     },
     "how_to_read": {
      "type": "string"
     },
     "method": {
      "type": "string"
     },
     "results_csv": {
      "type": "string",
      "format": "uri"
     },
     "results_page": {
      "type": "string",
      "format": "uri"
     },
     "dataset": {
      "type": "string",
      "format": "uri"
     },
     "attribution": {
      "type": "string"
     },
     "disclaimer": {
      "type": "string"
     },
     "generated_at": {
      "type": "string",
      "format": "date-time"
     },
     "stale": {
      "type": "boolean",
      "description": "true if the last refresh failed and an older copy is served"
     }
    }
   },
   "FeeQuote": {
    "type": "object",
    "required": [
     "input",
     "fee_cents",
     "total_cost_cents",
     "breakeven_win_rate_pct",
     "fee_schedule",
     "disclaimer"
    ],
    "properties": {
     "input": {
      "type": "object",
      "required": [
       "price_cents",
       "contracts",
       "order"
      ],
      "properties": {
       "price_cents": {
        "type": "number",
        "description": "Normalised price (tenths of a cent; whole cents between 10 and 90)"
       },
       "contracts": {
        "type": "integer"
       },
       "order": {
        "type": "string",
        "enum": [
         "taker",
         "maker"
        ]
       }
      }
     },
     "fee_cents": {
      "type": "integer",
      "description": "Total order fee in whole cents"
     },
     "fee_per_contract_cents": {
      "type": "number"
     },
     "total_cost_cents": {
      "type": "number"
     },
     "profit_if_win_cents": {
      "type": "number"
     },
     "loss_if_lose_cents": {
      "type": "number"
     },
     "breakeven_win_rate_pct": {
      "type": "number",
      "description": "Win rate needed to break even after the fee"
     },
     "breakeven_before_fees_pct": {
      "type": "number"
     },
     "wins_needed_per_loss": {
      "type": [
       "number",
       "null"
      ],
      "description": "null when the fee takes the whole profit"
     },
     "entry_price_bucket": {
      "type": [
       "string",
       "null"
      ]
     },
     "notes": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "fee_rule": {
      "type": "string"
     },
     "fee_schedule": {
      "type": "object",
      "required": [
       "fee_type",
       "fee_multiplier",
       "live"
      ],
      "properties": {
       "fee_type": {
        "type": "string"
       },
       "fee_multiplier": {
        "type": [
         "number",
         "string"
        ]
       },
       "checked_at": {
        "type": [
         "string",
         "null"
        ]
       },
       "source": {
        "type": "string"
       },
       "live": {
        "type": "boolean"
       },
       "stale": {
        "type": "boolean"
       }
      }
     },
     "matches": {
      "type": "string",
      "format": "uri"
     },
     "record_at_this_price": {
      "type": "string",
      "format": "uri"
     },
     "disclaimer": {
      "type": "string"
     }
    }
   },
   "BtcWindow": {
    "type": "object",
    "required": [
     "available"
    ],
    "description": "Kalshi public market data for the KXBTC15M window trading now. No model output, no signal.",
    "properties": {
     "available": {
      "type": "boolean"
     },
     "stale": {
      "type": "boolean"
     },
     "series": {
      "type": "string"
     },
     "ticker": {
      "type": [
       "string",
       "null"
      ]
     },
     "event_ticker": {
      "type": [
       "string",
       "null"
      ]
     },
     "open_time": {
      "type": [
       "string",
       "null"
      ]
     },
     "close_time": {
      "type": [
       "string",
       "null"
      ]
     },
     "window_open": {
      "type": "boolean"
     },
     "strike": {
      "type": [
       "number",
       "null"
      ]
     },
     "strike_source": {
      "type": [
       "string",
       "null"
      ]
     },
     "yes_ask_cents": {
      "type": [
       "number",
       "null"
      ]
     },
     "no_ask_cents": {
      "type": [
       "number",
       "null"
      ]
     },
     "yes_bid_cents": {
      "type": [
       "number",
       "null"
      ]
     },
     "no_bid_cents": {
      "type": [
       "number",
       "null"
      ]
     },
     "last_price_cents": {
      "type": [
       "number",
       "null"
      ]
     },
     "rule": {
      "type": [
       "string",
       "null"
      ]
     },
     "kalshi_url": {
      "type": [
       "string",
       "null"
      ]
     },
     "fee": {
      "type": "object"
     },
     "spot": {
      "type": [
       "object",
       "null"
      ]
     },
     "server_time": {
      "type": [
       "string",
       "null"
      ]
     },
     "fetched_at": {
      "type": [
       "string",
       "null"
      ]
     },
     "upstream": {
      "type": [
       "string",
       "null"
      ]
     },
     "note": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "additionalProperties": true
   },
   "Error": {
    "type": "object",
    "required": [
     "error"
    ],
    "properties": {
     "error": {
      "type": "string"
     },
     "docs": {
      "type": "string"
     },
     "example": {
      "type": "string"
     }
    }
   }
  }
 }
}
