{
  "id": "hedge",
  "version": "8693426dfa20",
  "status": "published",
  "name": "Hedge Calculator",
  "question": "How much should I hedge?",
  "summary": "Computes the stake on the opposite side of a bet that gives the same profit whichever side wins, or that breaks even if the original bet loses, and the result of each outcome.",
  "category": "game",
  "subcategory": "betting",
  "url": "https://www.acalculator.org/game/hedge-calculator",
  "markdown": "https://www.acalculator.org/game/hedge-calculator.md",
  "kind": "function",
  "method": "With original stake S₁ at decimal odds d₁ and hedge odds d₂: equal result H = S₁ × d₁ ÷ d₂; break even H = S₁ ÷ (d₂ − 1). Profit if the original wins = S₁(d₁ − 1) − H; if the hedge wins = H(d₂ − 1) − S₁.",
  "assumptions": [
    "The two bets cover opposite outcomes, and exactly one of them wins (no draw or push).",
    "The original bet is already placed at the original odds; the hedge is placed now at the hedge odds.",
    "Results are mathematics, not betting advice."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "format": {
        "title": "Odds format",
        "description": "The format of both odds: American, decimal, or fractional.",
        "type": "string",
        "enum": [
          "american",
          "decimal",
          "fractional"
        ]
      },
      "odds": {
        "title": "Original odds",
        "description": "The odds of the bet you already placed.",
        "type": "string",
        "maxLength": 30
      },
      "stake": {
        "title": "Original stake",
        "description": "The amount of the bet you already placed.",
        "type": "number",
        "x-unit": "USD",
        "exclusiveMinimum": 0,
        "maximum": 1000000000
      },
      "hedgeOdds": {
        "title": "Hedge odds",
        "description": "The odds now offered on the opposite outcome.",
        "type": "string",
        "maxLength": 30
      },
      "mode": {
        "title": "Hedge to",
        "description": "Equal profit either way, break even if the original bet loses, or a hedge stake you choose yourself.",
        "type": "string",
        "enum": [
          "equal",
          "breakeven",
          "custom"
        ]
      },
      "hedgeStake": {
        "title": "Hedge stake",
        "description": "The hedge stake you choose.",
        "type": "number",
        "x-unit": "USD",
        "minimum": 0,
        "maximum": 1000000000000
      }
    }
  },
  "outputs": {
    "hedge": {
      "label": "Hedge stake",
      "description": "The amount to bet on the opposite outcome at the hedge odds.",
      "format": "money"
    },
    "ifOriginal": {
      "label": "Profit if the original bet wins",
      "description": "Original stake × (original decimal odds − 1) − hedge stake.",
      "format": "money"
    },
    "ifHedge": {
      "label": "Profit if the hedge wins",
      "description": "Hedge stake × (hedge decimal odds − 1) − original stake.",
      "format": "money"
    },
    "totalStake": {
      "label": "Total staked",
      "description": "Original stake + hedge stake.",
      "format": "money"
    },
    "unhedged": {
      "label": "Profit without a hedge",
      "description": "What the original bet alone wins: original stake × (original decimal odds − 1).",
      "format": "money"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "format": "american",
      "odds": "+400",
      "stake": 100,
      "hedgeOdds": "-150",
      "mode": "equal",
      "hedgeStake": 50
    },
    "outputs": {
      "hedge": 300,
      "ifOriginal": 100,
      "ifHedge": 100,
      "totalStake": 400,
      "unhedged": 400
    },
    "text": "Hedge $300.00 at -150: your net result is $100.00 if the original bet wins and $100.00 if the hedge wins (a minus sign is a loss)."
  },
  "examples": [
    {
      "given": {
        "format": "american",
        "odds": "+400",
        "stake": 100,
        "hedgeOdds": "-150",
        "mode": "equal"
      },
      "expect": {
        "hedge": 300,
        "ifOriginal": 100,
        "ifHedge": 100,
        "totalStake": 400,
        "unhedged": 400
      },
      "source": "hand calculation in content.mdx: 100 × 5 ÷ (5/3) = 300; 400 − 300 = 100; 300 × 2/3 − 100 = 100"
    },
    {
      "given": {
        "format": "american",
        "odds": "+400",
        "stake": 100,
        "hedgeOdds": "-150",
        "mode": "breakeven"
      },
      "expect": {
        "hedge": 150,
        "ifOriginal": 250,
        "ifHedge": 0
      },
      "source": "hand calculation in content.mdx: 100 ÷ (2/3) = 150; 400 − 150 = 250"
    },
    {
      "given": {
        "format": "decimal",
        "odds": "3",
        "stake": 50,
        "hedgeOdds": "2",
        "mode": "custom",
        "hedgeStake": 40
      },
      "expect": {
        "hedge": 40,
        "ifOriginal": 60,
        "ifHedge": -10,
        "totalStake": 90
      },
      "source": "hand calculation in content.mdx: 50 × 2 − 40 = 60; 40 × 1 − 50 = −10"
    }
  ],
  "sources": [
    "Wikipedia, Hedge (finance), hedging a bet: https://en.wikipedia.org/wiki/Hedge_(finance)",
    "Wikipedia, Fixed-odds betting (fractional, decimal and moneyline odds): https://en.wikipedia.org/wiki/Fixed-odds_betting",
    "National Council on Problem Gambling, help and treatment (1-800-MY-RESET): https://www.ncpgambling.org/help-treatment/"
  ],
  "related": [
    "arbitrage",
    "parlay",
    "betting",
    "odds"
  ],
  "changelog": [
    {
      "date": "2026-09-28",
      "note": "Odds parser shapes and decimal comma; answer sentence says net result (WP-70 QA)."
    }
  ]
}
