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.
The integration consists of the following steps:
- Consume the predictions feed - a separate feed with the same specification as the Odds Feed.
- Fetch market names and settlement rules from the Sport events API.
- Place bets through the Managed trading services API with the
feed_idfield in selections. - 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_idis a dedicated prediction sport, for example,prediction_cryptoorprediction_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.typeis2(Prediction).fixture.logois the URL of the event logo.fixture.end_time_nsis the time when the event ends.tournamentis a placeholder with the nameOther; prediction events are grouped by sport.competitorsis an empty list.- Markets have
type_id: 0and emptyspecifiers. Market names are not present in the feed - fetch them from the Sport events API. - Outcome names come from the odds
templatevalues, for example,YesandNo. cash_out_availableis alwaysfalse.
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 | |
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 | |
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 | |
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 | ❌ |