The Betfair Exchange tries to match bets against the bets placed by other users as well as equivalent bets where possible. These "virtual" bets follow the rules for cross-matching as outlined in the API documentation
For example, if a customer backs Player A in a tennis match at odds of 2.0, the exchange matches any lay bet at odds of 2.0 or better on Player A. Besides, the Exchange also calculates all possible matches that are equivalent to a lay bet on Player A. So, if a customer backs Player B at odds of 2.0 or better, the Exchange matches it with the back bet on Player A. The Betfair website calculates the possible virtual bets that the Betfair Sports Exchange creates and displays those bets as if they were placed by other customers normally.
In other words, bets displayed on the Betfair website may be actual bets placed by customers, or virtual bets that the website knows the Betfair Exchange will match due to the cross-matching rules.
By default, virtual bets are not returned via the Betfair API when making a request to listMarketBook.
However, you can return virtual bets in the response when using the Betfair API by including the virtualise":"true" parameter in the listMarketBook request or by subscribing to EX_BEST_OFFERS_DISP via the Exchange Stream API
e.g. [{"jsonrpc": "2.0", "method": "SportsAPING/v1.0/listMarketBook", "params": {"marketIds":["1.114101556"],"priceProjection":{"priceData":["EX_BEST_OFFERS"],"virtualise":"true"}}, "id": 1}]
NOTE: It is important to understand that bets placed through the API are matched in the same way as bets placed on the website. In other words, a bet placed through the API is matched with either direct opposite bets or with the virtual bet, if available.
Reasons for difference in website vs API prices
- Using the Delayed rather than the Live API App Key. In this case, you will receive delayed data from the API. The delay is variable (price snapshots are returned with a delay of between 1-180 seconds).
- Using the website when logged out but viewing API prices via the Live App Key. Logged-out website customers are returned delayed data by default.
- Changing the bet view slider on the website to aggregate liquidity based on your required stake. The default across the website and API is £1 so any change to this setting on the website will provide a different view of prices vs what will be returned via the API. You can replicate the bet view slider using the PriceProjection > exBestOffersOverrides > RollUpModel > STAKE when making a listMarketBook request.
For example, the below request will return three back and lay prices only for the market and will roll up stakes so that only prices available for a stake of £100 or greater are returned
listMarketBook Request
[{"jsonrpc": "2.0", "method": "SportsAPING/v1.0/listMarketBook", "params": {"marketIds":["1.136857752"],"priceProjection":{"priceData":["EX_BEST_OFFERS"],"virtualise":"true","exBestOffersOverrides":{"bestPricesDepth":"3","rollupModel":"STAKE","rollupLimit":"100"}}}, "id": 1}]
Comments
0 comments
Article is closed for comments.