# Odds Change

`odds_change` messages are sent whenever Betradar provides updated odds for one or more markets in a match. These messages may include a subset of markets; any markets not included remain unchanged. For each reported market, all current outcomes and their respective odds are included.

**Message Elements and Attributes**

<details>

<summary>1. <strong>odds_change</strong></summary>

Describes all odds related changes

| Attribute(s)                                             | description                                                                                                                                                                                                                                                                                                                                                                          |
| -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| event\_id                                                | The ID of the event (match/race/outright) the odds information refers to.                                                                                                                                                                                                                                                                                                            |
| timestamp                                                | When the message was created in the odds producing system (milliseconds since Epoch UTC).                                                                                                                                                                                                                                                                                            |
| product                                                  | <p>Specifies which producer generated these odds. At any given point in time there should only be one product generating odds for a particular event. This tag can later be used when a producer is detected to be down.</p><ul><li>1 = LiveOdds producer</li><li>3 = Betradar Ctrl producer</li><li>4 = BetPal producer</li><li>5 = Premium Cricket producer</li></ul><p>etc...</p> |
| ~~<mark style="color:red;">odds\_change\_reason</mark>~~ | **Deprecated** ~~<mark style="color:red;">(Optional) can be set to "riskadjustment\_update" if this message is caused by a manual odds change.</mark>~~                                                                                                                                                                                                                              |

</details>

***

<details>

<summary>2. <strong>sport_event_status</strong></summary>

Reports various status information about the event that is relevant (see the special section on sport\_event\_status below for further description).

</details>

***

<details>

<summary>3. <strong>odds</strong> </summary>

Describes all odds updates for this event per market.

<table data-full-width="true"><thead><tr><th>Attributes</th><th>Description</th></tr></thead><tbody><tr><td>betstop_reason</td><td>Sent after a betstop while under betstop to signal the cause of the betstop.</td></tr><tr><td>betting_status</td><td><p>When set signals that markets have been opened again after a betstop, but it is still early after betstop. </p><p></p><p>Risk sensitive customers may decide to continue to keep the markets closed until <code>betting_status</code> is no longer present. </p><p></p><p>The value of <code>betting_status</code> signals the cause for the previous betstop. (See the API endpoint <code>descriptions/betting_status.xml</code> for the description of the individual betting status values)</p></td></tr></tbody></table>

</details>

***

<details>

<summary>4. <strong>Market</strong></summary>

Describes the odds updates for a particular market.

| Attributes           | Descripiton                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id                   | The ID of the market (see markets.xml for a detailed description of various markets).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| favourites           | If present, this is set to 1, which states that this is the most balanced or recommended market line. This setting makes most sense for markets where multiple lines are provided (e.g. the Totals market).                                                                                                                                                                                                                                                                                                                                                                      |
| specifiers           | A \| separated list of key=value-pairs. All keys are specified in the Betting API in the market descriptions. These are further specifiers for the market.                                                                                                                                                                                                                                                                                                                                                                                                                       |
| status               | <p>Active/suspended/deactivated:</p><ul><li><strong>active</strong> (1) = display odds & accept tickets</li><li><strong>suspended</strong> (-1) = display odds & don't accept tickets</li><li><strong>deactivated</strong> (0) = stop displaying odds & don't accept tickets</li><li><strong>handed\_over</strong> (-2)</li></ul><p><em>The default value is <strong>active</strong> if status is not present</em>. During recovery the following additional status may also be sent:</p><ul><li><strong>cancelled</strong> (-4)</li><li><strong>settled</strong> (-3)</li></ul> |
| extended\_specifiers | Additional info about this market that does not logically changes the market but is interesting for display purposes. Best example is Asian Handicap markets. Where the extended\_specifers is to to hcp\_for\_the\_rest\_of\_the\_match                                                                                                                                                                                                                                                                                                                                         |

</details>

***

<details>

<summary>5. <strong>outcome</strong></summary>

| Attribute(s) | Description                                                         |
| ------------ | ------------------------------------------------------------------- |
| id           | The outcome id                                                      |
| odds         | The odds for the specific outcome id                                |
| active       | Indicates if the outcome is active or not (0+not active, 1= active) |

</details>

***

<details>

<summary>6. <strong>market_metadata</strong></summary>

Additional information about a specific market (see more below)

| Attributes(s) | Description                                                                                                                                   |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| next\_betstop | Timestamp in UTC when to betstop this market. Typically used for outrights and typically is the start-time of the event the market refers to. |

</details>

***

<details>

<summary>7. <strong>odds_generation_properties</strong></summary>

Provided by the prematch odds producer only, and contains a few key-parameters that can be used in a client’s own special odds model, or even offer spread betting bets based on it.

| Attribute(s)        | Description                                                                                                                                                                   |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| expected\_totals    | Parameter that can be used by client’s own special odds model. Provided by prematch odds producer only. How many goals are expected in total.                                 |
| expected\_supremacy | Parameter that can be used by client’s own special odds model. Provided by prematch odds producer only. How big is the expected goal supremacy (home goals minus away goals)? |

</details>

**Message Example**

\
XML Example

```xml
<odds_change event_id="sr:match:1234" timestamp="1234" product="2">
<sport_event_status status="1" reporting="1" match_status="1" home_score="2" away_score="0">
     <clock match_time="10:00" remaining_time="50:00" stopped="true"/>
   </sport_event_status>
  <odds>
    <market id="47" specifiers="score=41.5" favourite="1" status="1">
      <outcome id="1" odds="1.12" active="1"/>
      <outcome id="2" odds="1.92" active="1"/>
    </market>
    <market id="48" specifiers="score=41.5" status="1">
      <outcome id="1" odds="1.12" active="1"/>
      <outcome id="2" odds="1.92" active="1"/>
    </market>
    <market id="49" status="0"/>
    <market id="123" specifiers="set=2|game=3|point=1" status="-1">
      <outcome id="1" odds="1.3" active="1"/>
      <outcome id="2" odds="1.7" active="1"/>
    </market>
    <market id="40" status="1">
      <outcome id="sr:player:1234" odds="1.4" active="1"/>
      <outcome id="sr:player:71111" odds="1.87" active="1"/>
      <outcome id="sr:player:9919" odds="1.9" active="1"/>
      <outcome id="sr:player:4322" active="0"/>
      <outcome id="sr:player:1119" active="0"/>
    </market>
  </odds>
</odds_change>
```

### Probabilities

You can configure the odds\_change message to receive probabilities too. These probabilities are then sent on each individual market outcome.

The probability attribute will not be included on an outcome with a probability lower than `1e-10`.

**XML Examples**

```xml
<odds>
  <market id="47" specifiers="score=41.5" favourite="1" status="1">
    <outcome id="1" odds="1.12" probabilities="0.6836763” active="1"/>
    <outcome id="2" odds="1.92" probabilities="0.8836763” active="1"/>
  </market>
  <market id="48" specifiers="score=42.5">
    <outcome id="1" odds="1.12" probabilities="0.1836763” active="1"/>
    <outcome id="2" odds="1.92" probabilities="0.3336763” active="1"/>
  </market>
  <market id="49" status="deactivated"/>
  <market id="123" specifiers="set=2|game=3|point=1" status="-1">
    <outcome id="1" odds="1.3" probabilities="0.77346763” active="1"/>
    <outcome id="2" odds="1.7" probabilities="0.32946763” active="1"/>
  </market>
</odds>
```

### Sport event status element

The element `sport_event_status` is provided in the odds\_change message is a very important part of the odds\_change messages. See the [sport even status](https://docs.sportradar.com/uof/data-and-features/messages/event/odds-change/sport-event-status) page for more information about this element.

### Match Status and Market Status

Market '***status**'* in `odds_change` message should NOT be considered to determine the status of match. Consider '*match\_status' instead.*

* *match\_status="0" indicates the match is "not started".*
* when *market\_status="0"* and *match\_status="1"* , the match is in-play.

You should grey out the markets whose status=0 (customers should not be able to bet) untill you receive *status="1"* in the following odds change message.

{% hint style="danger" %}
*When a market is temporarily suspended it will be received with a market status = -1. However there are instances during a live match where markets are temporarily not being offered, in those cases the markets will not be suspended but instead be deactivated via market status = 0. Those markets can later be re-activated again via market status = 1. Depending on the state of the live game this can lead to certain marketlines to remain deactivated while new marketlines are provided as active.”*
{% endhint %}

* The match\_status=“100" indicates that the match is over (status: ended)

When the match is over, it should be removed from the offer

### Handling odds\_change message without markets/market lines

An odds\_change message without markets means that some other information has changed (for example sport\_event\_status might have changed), but the markets have not.

In this case we advise that you update the information that has changed, and keep the market status, values and odds like they are. There is no indication of what has been changed, so it is best to process the whole message and update your data accordingly.

An odds\_change without markets may look something like this:

**XML Examples**

```xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<odds_change product="3" event_id="sr:match:18427576" timestamp="1565462926275">
   <sport_event_status status="0" match_status="0"/>
   <odds_generation_properties expected_totals="2.52327" expected_supremacy="-0.443045"/>
   <odds/>
</odds_change>
```
