{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/odds-api-io/json-schema/odds-api-io-dto-arbitrage-opportunity-schema.json",
  "title": "dto.ArbitrageOpportunity",
  "x-generated": "2026-11-06",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/odds-api-io-openapi.json#/components/schemas/dto.ArbitrageOpportunity",
  "type": "object",
  "properties": {
    "event": {
      "description": "Only included if includeEventDetails=true",
      "allOf": [
        {
          "$ref": "#/$defs/dto.EventInfo"
        }
      ]
    },
    "eventId": {
      "type": "integer"
    },
    "firstSeenAt": {
      "type": "string",
      "format": "date-time",
      "description": "When this combination first appeared"
    },
    "id": {
      "type": "string",
      "description": "{eventId}-{market}[-{hdp}] followed by {bookmaker}-{side} for each leg"
    },
    "impliedProbability": {
      "type": "number",
      "description": "Sum of 1/odds across the legs, using netOdds where fees apply; below 1 for an arbitrage"
    },
    "legs": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/dto.ArbitrageLeg"
      }
    },
    "market": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "hdp": {
          "type": "number",
          "description": "Line for Spread and Totals markets; omitted when the market has no line"
        }
      }
    },
    "optimalStakes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/dto.OptimalStake"
      }
    },
    "profitMargin": {
      "type": "number",
      "description": "Margin at the quoted prices after exchange fees, as a percentage of totalStake (2.48 means 2.48%)"
    },
    "totalStake": {
      "type": "number",
      "description": "1000, or less when a leg's maxStake caps the split; scale optimalStakes to your bankroll"
    },
    "updatedAt": {
      "type": "string",
      "description": "Last time the opportunity was confirmed"
    }
  },
  "$defs": {
    "dto.ArbitrageLeg": {
      "type": "object",
      "properties": {
        "bookmaker": {
          "type": "string"
        },
        "bookmakerFixtureId": {
          "type": "string",
          "description": "The bookmaker's own event id, when known. Not present on every response."
        },
        "href": {
          "type": "string",
          "description": "Link to the event on the bookmaker, or \"N/A\" when none is known."
        },
        "odds": {
          "type": "string",
          "description": "Decimal odds"
        },
        "netOdds": {
          "type": "string",
          "description": "Price after exchange fees (for example exchange commission or prediction-market taker fees). Only present when fees apply; profitMargin, impliedProbability and optimalStakes use this price."
        },
        "maxStake": {
          "type": "number",
          "description": "Stake limit reported by the bookmaker for this price, when known. optimalStakes never exceed it."
        },
        "oddsUpdatedAt": {
          "type": "string",
          "format": "date-time",
          "description": "Last time we wrote this bookmaker price. May be absent."
        },
        "side": {
          "type": "string",
          "enum": [
            "home",
            "away",
            "draw",
            "over",
            "under"
          ]
        }
      }
    },
    "dto.EventInfo": {
      "type": "object",
      "properties": {
        "away": {
          "type": "string"
        },
        "date": {
          "type": "string"
        },
        "home": {
          "type": "string"
        },
        "league": {
          "type": "string"
        },
        "sport": {
          "type": "string"
        }
      }
    },
    "dto.OptimalStake": {
      "type": "object",
      "properties": {
        "bookmaker": {
          "type": "string"
        },
        "potentialReturn": {
          "type": "number",
          "description": "Payout if this leg wins; the same for every leg up to rounding"
        },
        "side": {
          "type": "string"
        },
        "stake": {
          "type": "number"
        }
      }
    }
  }
}