Markets and Outcomes

1. Sometimes I get an "odds_change" message from the feed which contains no markets or markets containing no outcomes. Is that OK?

An "odds_change" message also contains an "event_status" element, providing the current status of the associated sport event. An odds_change message with no markets is therefore sometimes sent by the feed to provide the updated status of the sport event. Worth noting: the "odds_change" message can come without markets or with markets containing no outcomes.

2. How to get referenced competitor from outright market outcomes?

JAVA
public void onOddsChange(OddsFeedSession sender, OddsChange<SportEvent> oddsChanges) {
    SportEvent event = oddsChanges.getEvent();
    logger.info("Received odds change for: " + event);
 
    Season season = (Season) oddsChanges.getEvent();
    for (MarketWithOdds market : oddsChanges.getMarkets()) {
        for (OutcomeOdds outcome : market.getOutcomeOdds()) {
            String outcomeId = outcome.getId();
            Competitor competitor = uofSdk.getSportDataProvider().getCompetitor(Urn.parse(outcomeId));
            String competitorReference = competitor.getReferences().getReferences().get("competitor");
        }
    }
}

Last updated

Was this helpful?