Skip to content

Predictions integration

Prediction markets let your users bet on the outcomes of real-world events: asset prices, politics, technology, culture, and other categories. Prediction events are delivered as sport events with markets and odds through the same trading infrastructure you already use, so most of the integration is already in place if you consume the Odds Feed and place bets through Bets.

Predictions integration scheme

The integration consists of the following steps:

  1. Consume the predictions feed - a separate feed with the same specification as the Odds Feed.
  2. Fetch market names and settlement rules from the Sport events API.
  3. Place bets through the Managed trading services API with the feed_id field in selections.
  4. Embed the Multi Widget for prediction events.

Prerequisites

The predictions integration builds on the trading integration:

  • Authorization - the same x.509 certificate is used for all predictions endpoints.
  • Odds Feed - the predictions feed follows this specification.
  • Bets - bets on prediction events are placed through the same MTS API.

Predictions feed

The predictions feed is a separate feed that follows the Odds Feed specification - the same replication protocol, message format, and entities:

Environment Endpoint
Integration https://predictions-feed.int.databet.cloud
Production https://predictions-feed.databet.cloud

Booking of prediction events will be added in the next iterations: for now, you receive the whole feed in both environments.

The feed carries everything you need to offer and accept bets: identity, English display strings, odds, statuses, and timings. Localized content - market names and settlement rules - is fetched on demand from the Sport events API, which never carries betting state.

Differences from the trading feed

Prediction events differ from regular sport events in the following ways:

  • sport_id is a dedicated prediction sport, for example, prediction_crypto or prediction_politics. Prediction sports are marked with the prediction sport type in the Dictionary API. The set of prediction sports expands over time, so treat unknown prediction sports as not enabled until you support them.
  • fixture.type is 2 (Prediction).
  • fixture.logo is the URL of the event logo.
  • fixture.end_time_ns is the time when the event ends.
  • tournament is a placeholder with the name Other; prediction events are grouped by sport.
  • competitors is an empty list.
  • Markets have type_id: 0 and empty specifiers. Market names are not present in the feed - fetch them from the Sport events API.
  • Outcome names come from the odds template values, for example, Yes and No.
  • cash_out_available is always false.
An example of a prediction event snapshot The output is formatted for readability; markets are truncated to two.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
{
  "sport_event_id": "23784",
  "sport_id": "prediction_politics",
  "version": "0000000004b8ae57",
  "timestamp_ns": 1785329056296000000,
  "event_type": "sport_event_snapshot",
  "payload": {
    "fixture": {
      "type": 2,
      "status": 0,
      "streams": [],
      "sport_id": "prediction_politics",
      "template": "What will happen before GTA VI?",
      "logo": "https://static.databet.cloud/predictions/23784.png",
      "tournament": {
        "id": "prediction:prediction_politics:other",
        "name": "Other"
      },
      "venue": { "country_code": "" },
      "competitors": [],
      "live_coverage": false,
      "start_time_ns": 1746200890582000000,
      "end_time_ns": 1798761599000000000,
      "updated_at_ns": 1781888515173224000
    },
    "markets": [
      {
        "id": "540817",
        "status": 1,
        "type_id": 0,
        "specifiers": "",
        "odds": [
          {
            "id": "1",
            "value": "1.82",
            "probability": "0.505",
            "status": 0,
            "is_active": true,
            "template": "Yes",
            "cash_out_available": false
          },
          {
            "id": "2",
            "value": "1.85",
            "probability": "0.495",
            "status": 0,
            "is_active": true,
            "template": "No",
            "cash_out_available": false
          }
        ]
      },
      {
        "id": "540818",
        "status": 1,
        "type_id": 0,
        "specifiers": "",
        "odds": [
          {
            "id": "1",
            "value": "1.82",
            "probability": "0.505",
            "status": 0,
            "is_active": true,
            "template": "Yes",
            "cash_out_available": false
          },
          {
            "id": "2",
            "value": "1.85",
            "probability": "0.495",
            "status": 0,
            "is_active": true,
            "template": "No",
            "cash_out_available": false
          }
        ]
      }
    ],
    "bet_stop": false,
    "game_state": {},
    "competitors_score": [],
    "extensions": {
      "app.data.bet/widget": {
        "types": ["outcome_probabilities"]
      }
    }
  }
}

Placing bets

Bets on prediction events are placed through the same Managed trading services API. To validate a bet, send POST /bets/calculate; to place it, send POST /bets - the same workflow as in Risk Management Mode.

Each selection carries the feed_id field identifying the feed the sport event belongs to: 0 - trading feed, 1 - predictions feed. Sport event ids are unique within a feed, so the pair of feed_id and sport_event_id identifies a sport event globally. Always send feed_id: 1 in selections referencing prediction events; if the field is omitted, the selection is resolved against the trading feed.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{
  "selections": [
    {
      "sport_event_id": "659757",
      "market_id": "701491",
      "odd_id": "1",
      "value": "25.75",
      "feed_id": 1
    }
  ]
}

Restrictions that reference a sport event also carry feed_id, so you can correlate them with the correct selection.

Risk management is mandatory

Bets containing prediction selections are always processed in Risk Management Mode: max_bet restrictions apply and cannot be disabled, and Integrity Mode and Advisory Mode are not available for prediction selections. Bets on the trading feed keep the MTS mode you integrated.

All bet types are supported: single, express, and system. An express or system bet may include at most one prediction selection - combining multiple prediction selections in one bet is not supported. A bet may combine trading and prediction selections; such a bet is processed in Risk Management Mode as a whole.

Widgets

For a complete integration, embed the Multi Widget for prediction events - it renders the widget corresponding to the event, for example, outcome probabilities or an asset price chart. The rule is the same as for regular sport events: render the widget when the app.data.bet/widget extensions list of the event is not empty, and do not initialize it otherwise. The possible widget types for prediction events are outcome_probabilities, asset_price_up_down, and asset_price_general. See Integrating DATA.BET Widgets.

1
2
3
4
5
"extensions": {
  "app.data.bet/widget": {
    "types": ["outcome_probabilities", "asset_price_up_down"]
  }
}

Managing prediction markets

Prediction markets are managed in the same Sport Trading Management panel as regular sport events. Booking of prediction events will be added in the next iterations; until then, the whole feed is always delivered.

Feature availability

Feature Availability
Single, express, and system bets
Multiple prediction selections in one bet
Mixed bets combining trading and prediction selections ✅ (at most one prediction selection per bet)
Widgets (Multi Widget)
Risk Management Mode ✅ (mandatory)
Integrity Mode
Advisory Mode
Cash Out
Bet Builder
Booking 🔜 Planned for the next iterations
Disabling max bet