Market info
This channel gives information about active markets. The main point of this channel is to provide
more optimised way of live updates that happen to a market. When something in the market changes
the market_update message will be sent to the channel. Content of the message is a JSON object
containing mandatory market_id and timestamp keys. This helps to identified which market changed
and when. Other than this, the object can contain any of the fields that are returned by the
/api/market_info endpoint provided that they changed.
MarketInfo object
Section titled “MarketInfo object”The MarketInfo object consists of 2 kind of properties, static that never change and dynamic
that can change and when changed are pushed to the socket.
Static fields
Section titled “Static fields”The following properties are set when the market is created and never change:
market_id: The id of the market.event_id: The id of the event that the market is attached to.description: The description of the market.title: The human readable title for the market.short_title: The human readable short title for the market.group_title: The human readable group title for the market; used in groupings in the app.question: The question that the market is asking.position: The text to use in describing the position.event_type: The type of event associated with the market.rules: The rules that govern the market.specifier: The specifier for therulesto properly determine the market result and status.max_price: The max price for orders and settlements in this market.order_price_rules: a JSON object describing the rules how the order’s price should increment/decrement on the UI.sort: A list of MarketInfo fields to use for the initial sorting of markets.sport: Sport that the event is in, e.g.Basketball,Tennis.competition: Competition that the event is in, e.g.NFL,US Open.participants: Market participants (teams or opponents). Structure is event type dependent.
Order Price Rules
Section titled “Order Price Rules”A map describing how the order price can change in given price ranges. The structure is an array with elements like this:
{"from" => integer, "to" => integer, "inc" => integer}}Example:
[{"from": 1, "to": 100, "inc": 10}, {"from": 101, "to": 9900, "inc": 100}, {"from": 9901, "to": 9999, "inc": 10}]Meaning that when the order’s price is between 1 and 100 cents (inclusive, note that 0 is not
a valid order’s price) the +/- buttons on the UI should increment/decrement the price by 10 cents.
When the price is between 101 and 9900 the buttons should increment by 100 cents.
When the price is between 9901 and 9999 the buttons should increment by 10 cents (9999 is the max
valid price for an order).
Fields that can be updated via socket
Section titled “Fields that can be updated via socket”timestamp: The timestamp of when this market info was created.status: The status of the market (scheduled,pre_open,open,suspended,closed,cancelled).result: The result of the market (pending,won,lost,void).settled_at: The UTC time when the market was resulted or voided.archived: Is the market archived or not.filters: The list of filters to use when organizing markets.trading_filters: The list of filters to use for organizing trades, settlements and related items.home_category: The category in which the market appears. It allows easily determine if the market isUpcoming,Liveor without a category.event_status: The status of the event that the market is attached to (scheduled,in_progress,completed,cancelled).event_start: The UTC start date and time of the event.event_brief: The string that can be used for the brief on the market’s event.detailed_event_brief: The string that can be used for the detailed brief on the market’s event.last_traded_price: The price of the last executed trade.volume_24h: The volume that has been traded on the market in the last 24 hours.total_volume: The total volume traded in the market. This is calculated by summing thequantityfield of all trades associated with this market.price_change_24h: The change in price over the last 24 hours.recent_trades: A list of the last 15 recent trades on the market.bids: The top bids on the market. An array with object containing thepriceand the accumulatedquantityat that price.offers: The top offers on the market. The structure is the same as forbids.price: The market price that the market is trading at.probability: The win probability for the market.manual_probability: Is the probability manual or from odds provider.last_probability_at: The time that the last probability was received by the server from the feed.
Joining Global Channel
Section titled “Joining Global Channel”["3","3","market_info","phx_join", ""]Delta updates to markets
Section titled “Delta updates to markets”When a market is updated, only changed fields will be included in the pushed message.
Every push will have the mandatory market_id and timestamp fields indicating what market change
and when. Other keys in the map are optional and are included if this changed comparing to previous
state of the market.
Market status changes are pushed immediately when they happen. All the other changes like bids
offers, recent_trades, event_biref are send on a cadences. The interval is configurable,
current default is 2 seconds.
Status change
Section titled “Status change”[null,null,"market_info","market_updated",{"017511eb-930b-492a-8933-2284067e3039": {"market_id":"017511eb-930b-492a-8933-2284067e3039","status":"pre_open","timestamp":"2021-03-24T13:11:42.113364Z"}}]Game starts
Section titled “Game starts”[null,null,"market_info","market_updated",{"256910ed-213c-44bb-8b9b-66d48689e42b": {"event_brief":"PHX 0 - 0 ORL : Q1 12:00","event_status":"in_progress","market_id":"256910ed-213c-44bb-8b9b-66d48689e42b","timestamp":"2021-03-24T13:24:51.138859Z"}}]Game closes
Section titled “Game closes”[null,null,"market_info","market_updated",{"256910ed-213c-44bb-8b9b-66d48689e42b": {"settled_at":"2021-03-24T13:26:57.791844Z","market_id":"256910ed-213c-44bb-8b9b-66d48689e42b","price":1.0e4,"result":"won","status":"resulted","timestamp":"2021-03-24T13:26:57.802121Z"}}]Probability changed
Section titled “Probability changed”[null,null,"market_info","market_updated",{"fcab0df4-2c78-462c-a52e-9e859467bd29": {"last_probability_at":"2021-03-24T13:12:01.979223Z","market_id":"fcab0df4-2c78-462c-a52e-9e859467bd29","probability":0.319857,"timestamp":"2021-03-24T13:12:01.979329Z"}}]Requesting all active markets info
Section titled “Requesting all active markets info”Request:
["3","3","market_info","all", ""]Reply:
["3","3","market_info","phx_reply",{"response":{"markets":{ "9a76544a-2678-46a9-a208-834aa0c06900" : { MARKET_INFO_OBJ1_KEYS_VALUES }, "MARKET_UUID_2" : { MARKET_INFO_OBJ2_KEYS_VALUES }, "MARKET_UUID_3" : { MARKET_INFO_OBJ3_KEYS_VALUES }}}]Newly created market push
Section titled “Newly created market push”The market creation push happens when the market changes state to pre_open.
[null,null,"market_info","market_created",{"e3156733-502a-495e-a0cf-5d1dda04b3c6": {"settled_at":null,"conference":"Eastern","description":"Contracts for this market settle into $100 if the Chicago Bulls beat the Cleveland Cavaliers and settle into $0 if they do not.","game_time":"2021-03-25T00:00:00Z","result":"pending","position_description":"Chicago Bulls","team":null,"filters":[{"category":"NBA","section":"Week 14","subcategory":"Game"}],"event_brief":"Starts March 25, 00:00","division":"Central","question":"Will the Chicago Bulls defeat the Cleveland Cavaliers?","price":null,"price_change_24h":null,"home_team":"Chicago Bulls","timestamp":"2021-03-24T12:58:30.869725Z","manual_probability":false,"title":"NBA - Week 14 CLE @ CHI","event_status":"scheduled","archived":false,"status":"open","recent_trades":[],"city":"Chicago","market_type_id":6,"schedule":"Week 14","event_type":"basketball_game","position":"Chicago Bulls","market_id":"e3156733-502a-495e-a0cf-5d1dda04b3c6","market_type":"Game","bids":[],"event_start":"2021-03-25T00:00:00Z","id":"e3156733-502a-495e-a0cf-5d1dda04b3c6","offers":[],"last_traded_price":null,"away_team":"Cleveland Cavaliers","league_id":3,"last_probability_at":"2021-03-24T12:58:30.869637Z","rules":"home_winner","event_id":"86c9d896-62ab-4c59-8f1c-4cc7850c19c3","volume_24h":null,"probability":0.677168}}]
