Not getting exact prices as I see them on Betfair Exchange UI

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mayoman1973
    Junior Member
    • Jan 2017
    • 8

    #1

    Not getting exact prices as I see them on Betfair Exchange UI

    I have a Java based app that is almost complete with one problem.
    When I retrieve pricing data about 1 in every 4 prices are not same as I see in the "Available To Back" price on the exchange.

    This is my request JSON
    Code:
    {  
       "jsonrpc":"2.0",
       "method":"SportsAPING/v1.0/listMarketBook",
       "id":1,
       "params":{  
          "matchProjection":"ROLLED_UP_BY_PRICE",
          "orderProjection":"EXECUTABLE",
          "marketIds":[  
             "1.129446246",
             "1.129446245",
             "1.129446210",
             "1.129446207",
             "1.129446208"
          ],
          "priceProjection":{  
             "priceData":[  
                "EX_ALL_OFFERS"
             ],
             "virtualise":false,
             "rolloverStakes":false
          }
       }
    }
    and this is my response.
    But the first price in price data list is not correct in about 1 in 4. Is there something wrong in the JSON request paramerters? Same goes for the Lay prices, they are not correct in 1 in 4 cases.


    {"jsonrpc":"2.0","result":[{"marketId":"1.129446207","isMarketDataDelayed":tr ue,"status":"OPEN","betDelay":0,"bspReconciled":fa lse,"complete":true,"inplay":false,"numberOfWinner s":1,"numberOfRunners":9,"numberOfActiveRunners":8 ,"lastMatchTime":"2017-02-02T11:44:53.398Z","totalMatched":20099.62,"totalAv ailable":467980.91,"crossMatching":false,"runnersV oidable":false,"version":1547298319,"runners":[{"selectionId":10814477,"handicap":0.0,"status":"A CTIVE","adjustmentFactor":39.37,"lastPriceTraded": 2.76,"totalMatched":0.0,"ex":{"availableToBack":[{"price":2.76,"size":10.44},{"price":2.74,"size":1 07.26},{"price":2.72,"size":14.73}],"availableToLay":[{"price":2.8,"size":101.47},{"price":2.86,"size":1 7.81},{"price":2.96,"size":94.0}],"tradedVolume":[]}},{"selectionId":10889389,"handicap":0.0,"status" :"ACTIVE","adjustmentFactor":27.33,"lastPriceTrade d":3.2,"totalMatched":0.0,"ex":{"availableToBac k":[{"price":3.15,"size":142.85},{"price":3.1,"size":1 86.1},{"price":3.05,"size":272.45}],"availableToLay":[{"price":3.2,"size":28.47},{"price":3.25,"size":12 48.64},{"price":3.3,"size":2546.0}],"tradedVolume":[]}},{"selectionId":8907127,"handicap":0.0,"status": "ACTIVE","adjustmentFactor":22.449,"lastPriceTrade d":4.3,"totalMatched":0.0,"ex":{"availableToBac k":[{"price":4.2,"size":26.67},{"price":4.1,"size":447 .0},{"price":4.0,"size":296.3}],"availableToLay":[{"price":4.5,"size":15.36},{"price":5.0,"size":58. 2},{"price":5.3,"size":47.0}],"tradedVolume":[]}},{"selectionId":10904857,"handicap":0.0,"status" :"ACTIVE","adjustmentFactor":4.099,"lastPriceTrade d":25.0,"totalMatched":0.0,"ex":{"availableToBack" :[{"price":23.0,"size":10.63},{"price":21.0,"size":1 3.22},{"price":20.0,"size":12.91}],"availableToLay":[{"price":25.0,"size":12.73},{"price":60.0,"size":1 0.42},{"price":1000.0,"size":11.77}],"tradedVolume":[]}},{"selectionId":8893244,"handicap":0.0,"status": "ACTIVE","adjustmentFactor":2.773,"lastPriceTraded ":40.0,"totalMatched":0.0,"ex":{"availableToBa ck":[{"price":38.0,"size":15.48},{"price":32.0,"size":1 1.06},{"price":21.0,"size":17.58}],"availableToLay":[{"price":40.0,"size":15.9},{"price":150.0,"size":1 0.87},{"price":260.0,"size":35.25}],"tradedVolume":[]}},{"selectionId":8599303,"handicap":0.0,"status": "ACTIVE","adjustmentFactor":2.481,"lastPriceTraded ":46.0,"totalMatched":0.0,"ex":{"availableToBa ck":[{"price":44.0,"size":21.43},{"price":20.0,"size":1 2.64},{"price":17.5,"size":14.0}],"availableToLay":[{"price":46.0,"size":10.49},{"price":60.0,"size":1 0.9},{"price":65.0,"size":10.0}],"tradedVolume":[]}},{"selectionId":12273850,"handicap":0.0,"status" :"ACTIVE","adjustmentFactor":0.943,"lastPriceTrade d":170.0,"totalMatched":0.0,"ex":{"availableToBack ":[{"price":95.0,"size":10.65},{"price":48.0,"size":1 0.96},{"price":5.0,"size":218.56}],"availableToLay":[{"price":970.0,"size":10.45},{"price":1000.0,"size ":0.85}],"tradedVolume":[]}},{"selectionId":8877583,"handicap":0.0,"status": "ACTIVE","adjustmentFactor":0.555,"lastPriceTraded ":230.0,"totalMatched":0.0,"ex":{"availableToBack" :[{"price":210.0,"size":15.7},{"price":48.0,"size":1 1.53},{"price":5.0,"size":197.0}],"availableToLay":[{"price":1000.0,"size":9.74}],"tradedVolume":[]}},{"selectionId":9353722,"handicap":0.0,"status": "REMOVED","adjustmentFactor":28.986,"removalDate": "2017-02-02T10:05:46.000Z","ex":{"availableToBack":[],"availableToLay":[],"tradedVolume":[]}}]},{"marketId":"1.129446208","isMarketDataDelayed": true,"status":"OPEN","betDelay":0,"bspReconciled": false,"complete":false,"inplay":false,"numberOfWin ners":3,"numberOfRunners":9,"numberOfActiveRunners ":8,"lastMatchTime":"2017-02-02T11:43:31.368Z","totalMatched":1881.56,"totalAva ilable":16435.15,"crossMatching":false,"runnersVoi dable":false,"version":1547298321,"runners":[{"selectionId":10814477,"handicap":0.0,"status":"A CTIVE","adjustmentFactor":51.823,"lastPriceTraded" :1.24,"totalMatched":0.0,"ex":{"availableToBack":[{"price":1.23,"size":128.73},{"price":1.2,"size":1 1.3},{"price":1.14,"size":53.6}],"availableToLay":[{"price":1.26,"size":40.99},{"price":1.62,"size":1 0.0},{"price":3.5,"size":22.04}],"tradedVolume":[]}},{"selectionId":10889389,"handicap":0.0,"status" :"ACTIVE","adjustmentFactor":49.749,"lastPriceTrad ed":1.25,"totalMatched":0.0,"ex":{"availableToBack ":[{"price":1.25,"size":70.08},{"price":1.24,"size":5 1.1},{"price":1.2,"size":18.0}],"availableToLay":[{"price":1.31,"size":17.0},{"price":3.9,"size":15. 0},{"price":1000.0,"size":13.22}],"tradedVolume":[]}},{"selectionId":8907127,"handicap":0.0,"status": "ACTIVE","adjustmentFactor":48.268,"lastPriceTrade d":1.38,"totalMatched":0.0,"ex":{"availableToBack" :[{"price":1.39,"size":136.34},{"price":1.26,"size": 36.74},{"price":1.1,"size":82.0}],"availableToLay":[{"price":1.45,"size":16.07},{"price":1.47,"size":1 5.8},{"price":2.86,"size":20.0}],"tradedVolume":[]}},{"selectionId":10904857,"handicap":0.0,"status" :"ACTIVE","adjustmentFactor":22.542,"lastPriceTrad ed":3.55,"totalMatched":0.0,"ex":{"availableToBack ":[{"price":3.7,"size":116.11},{"price":3.65,"size":3 0.58},{"price":3.55,"size":78.43}],"availableToLay":[{"price":3.85,"size":45.07},{"price":250.0,"size": 27.5}],"tradedVolume":[]}},{"selectionId":8893244,"handicap":0.0,"status": "ACTIVE","adjustmentFactor":16.422,"lastPriceTrade d":6.4,"totalMatched":0.0,"ex":{"availableToBac k":[{"price":5.8,"size":14.71},{"price":2.02,"size":56 .66},{"price":2.0,"size":65.0}],"availableToLay":[{"price":6.6,"size":55.94},{"price":7.6,"size":48. 36},{"price":25.0,"size":22.4}],"tradedVolume":[]}},{"selectionId":8599303,"handicap":0.0,"status": "ACTIVE","adjustmentFactor":14.92,"lastPriceTraded ":5.8,"totalMatched":0.0,"ex":{"availableToBac k":[{"price":5.8,"size":13.63},{"price":5.6,"size":17. 46},{"price":4.5,"size":17.31}],"availableToLay":[{"price":8.8,"size":58.03},{"price":9.0,"size":37. 31},{"price":250.0,"size":20.0}],"tradedVolume":[]}},{"selectionId":12273850,"handicap":0.0,"status" :"ACTIVE","adjustmentFactor":6.099,"lastPriceTrade d":14.5,"totalMatched":0.0,"ex":{"availableToBack" :[{"price":14.5,"size":14.81},{"price":11.5,"size":1 1.96},{"price":3.75,"size":25.39}],"availableToLay":[{"price":17.5,"size":21.52},{"price":400.0,"size": 20.0},{"price":1000.0,"size":2.56}],"tradedVolume":[]}},{"selectionId":8877583,"handicap":0.0,"status": "ACTIVE","adjustmentFactor":3.647,"lastPriceTraded ":15.0,"totalMatched":0.0,"ex":{"availableToBa ck":[{"price":14.5,"size":20.89},{"price":11.5,"size":1 2.7},{"price":1.8,"size":85.76}],"availableToLay":[{"price":400.0,"size":27.66},{"price":1000.0,"size ":2.56}],"tradedVolume":[]}},{"selectionId":9353722,"handicap":0.0,"status": "REMOVED","adjustmentFactor":46.951,"removalDate": "2017-02-02T10:05:46.000Z","ex":{"availableToBack":[],"availableToLay":[],"tradedVolume":[]}}]},{"marketId":"1.129446210","isMarketDataDelayed": true,"status":"OPEN","betDelay":0,"bspReconciled": false,"complete":true,"inplay":false,"numberOfWinn ers":3,"numberOfRunners":9,"numberOfActiveRunners" :8,"lastMatchTime":"2017-02-02T11:41:44.048Z","totalMatched":274.23,"totalAvai lable":1956.87,"crossMatching":false,"runnersVoida ble":false,"version":1547298325,"runners":[{"selectionId":10814477,"handicap":0.0,"status":"A CTIVE","adjustmentFactor":39.37,"lastPriceTraded": 2.54,"totalMatched":0.0,"ex":{"availableToBack":[{"price":2.52,"size":16.45},{"price":2.5,"size":76 .52},{"price":2.46,"size":30.01}],"availableToLay":[{"price":2.72,"size":25.29},{"price":2.74,"size":2 1.4},{"price":2.78,"size":24.43}],"tradedVolume":[]}},{"selectionId":10889389,"handicap":0.0,"status" :"ACTIVE","adjustmentFactor":27.33,"lastPriceTrade d":2.98,"totalMatched":0.0,"ex":{"availableToBack" :[{"price":2.88,"size":14.9},{"price":2.76,"size":13 9.07},{"price":2.74,"size":46.56}],"availableToLay":[{"price":3.05,"size":10.2},{"price":3.4,"size":18. 16},{"price":25.0,"size":6.0}],"tradedVolume":[]}},{"selectionId":8907127,"handicap":0.0,"status": "ACTIVE","adjustmentFactor":22.449,"lastPriceTrade d":3.7,"totalMatched":0.0,"ex":{"availableToBac k":[{"price":3.6,"size":38.81},{"price":3.35,"size":58 .06},{"price":3.3,"size":35.65}],"availableToLay":[{"price":4.4,"size":23.29},{"price":4.6,"size":11. 81},{"price":4.8,"size":21.37}],"tradedVolume":[]}},{"selectionId":10904857,"handicap":0.0,"status" :"ACTIVE","adjustmentFactor":4.099,"lastPriceTrade d":12.5,"totalMatched":0.0,"ex":{"availableToBack" :[{"price":16.0,"size":15.3},{"price":14.0,"size":14 .3},{"price":3.85,"size":123.9}],"availableToLay":[{"price":20.0,"size":10.1},{"price":25.0,"size":24 .27},{"price":44.0,"size":11.12}],"tradedVolume":[]}},{"selectionId":8893244,"handicap":0.0,"status": "ACTIVE","adjustmentFactor":2.773,"totalMatched":0 .0,"ex":{"availableToBack":[{"price":28.0,"size":16.8},{"price":23.0,"size":13 .33},{"price":3.85,"size":127.53}],"availableToLay":[{"price":42.0,"size":22.5},{"price":60.0,"size":13 .38},{"price":70.0,"size":12.03}],"tradedVolume":[]}},{"selectionId":8599303,"handicap":0.0,"status": "ACTIVE","adjustmentFactor":2.481,"totalMatched":0 .0,"ex":{"availableToBack":[{"price":13.5,"size":29.23},{"price":3.85,"size":1 26.2}],"availableToLay":[{"price":55.0,"size":3.0}],"tradedVolume":[]}},{"selectionId":12273850,"handicap":0.0,"status" :"ACTIVE","adjustmentFactor":0.943,"totalMatched": 0.0,"ex":{"availableToBack":[{"price":44.0,"size":16.66},{"price":24.0,"size":1 8.53},{"price":4.2,"size":120.0}],"availableToLay":[],"tradedVolume":[]}},{"selectionId":8877583,"handicap":0.0,"status": "ACTIVE","adjustmentFactor":0.555,"totalMatched":0 .0,"ex":{"availableToBack":[{"price":30.0,"size":10.57},{"price":4.6,"size":12 8.52}],"availableToLay":[],"tradedVolume":[]}},{"selectionId":9353722,"handicap":0.0,"status": "REMOVED","adjustmentFactor":28.986,"removalDate": "2017-02-02T10:05:46.000Z","ex":{"availableToBack":[],"availableToLay":[],"tradedVolume":[]}}]},{"marketId":"1.129446245","isMarketDataDelayed": true,"status":"OPEN","betDelay":0,"bspReconciled": false,"complete":false,"inplay":false,"numberOfWin ners":1,"numberOfRunners":19,"numberOfActiveRunner s":19,"lastMatchTime":"2017-02-02T11:44:16.430Z","totalMatched":21451.67,"t...
    Last edited by mayoman1973; 02-02-2017, 12:54 PM.
  • Merlin
    Junior Member
    • Jan 2009
    • 56

    #2
    Hi mayoman1973,

    The listing on the exchange includes 'virtual bets', which are produced by a cross-matching algorithm including back and lay prices across all selections. There is an explanation of how it works in the documentation under 'Additional Information' > 'Virtual Bets'.

    The default behaviour for 'listMarketBook' is not to include these derived prices, but just to list the actual offers. You can get the virtual prices included by setting the 'virtualise' parameter of 'priceProjection' to 'true', which should then agree with what is shown on the exchange website.


    cheers

    Merlin

    Comment

    • mayoman1973
      Junior Member
      • Jan 2017
      • 8

      #3
      Boom.... That was it Merlin. Thanks a mil for the reply. I owe you a cut of my profits Trying to automate what I have been monitoring manually for past 6 mths.

      Comment

      Working...
      X