Be careful using async when placing bets

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • IGtrader
    Junior Member
    • Apr 2012
    • 18

    #16
    apology accepted

    Comment

    • bfexplorer
      Senior Member
      • Sep 2018
      • 212

      #17
      Originally posted by IGtrader View Post
      apology accepted
      Forgive me, but I did not apologize I do not have reason to apologize.

      I read your post: "... I just cracked a bug in my code which was stopping me using async when placing bets. ..." , and I thought you are talking about placing bets in asynchronous operation, not about async parameter in place orders method, as this is clearly declared in the documentation that bet id is not set.

      Therefor I really thought you are talking about different issue, because I really cannot understand how anyone can implement his code without actually knowing what he is doing, and the documentation is clear in this issue:

      https://docs.developer.betfair.com/d...ni/placeOrders

      "An order's status will be PENDING and no bet ID will be returned."

      Of course, you can say, I bought my code from other developer, so I did not read betfair documentation, so later I found this bug in my code, which is actually no bug at all. Or you can say, you did not understand my English, right?

      So do you really want to say me that you read the documentation "An order's status will be PENDING and no bet ID will be returned.", implemented your code and then later you wondered why there is bet Id null in response for placeOrders?

      In my first reply I just commented: "This is so wrong!"

      And yes, This is so wrong! because betfair implements something that is useless in most use case scenarios bot developers use their api for.

      In your case I said "This is so wrong!" because I really just thought that you are advocating not using async operations when programming betfair bots, because I saw such code many times, when asked to reprogram old bot code.

      I am used to have my code base implemented to the latest betfair api specification, so yes, I as well added sync parameter to placeOrders method, but that is on just betfair api wrapper, my application service never uses placeOrders with async parameter set to true, as my app allows concurrent operations on market and bet placing, so any bet operations needs full information about it.

      The only use case scenario for using placeOrders with async parameter set to true, is when in your app for instance, you manual place bets clicking on ladders, in such case there is no need to wait for full information about bet placing operation/s as you will get it with latest market update when using rest api.

      Before streaming api introduction, when you placed your bets and bet id was returned, you could be sure that next market update will return market data which included your placed bets as well, so in my bot code, as my app allows executing many bots on market selections, any bet operation were blocked till latest market update was loaded. My bots get execution time during market update procedure.

      But of course as betfair introduced order streaming through another service, the market data/bet status update is no more atomic, and that causes a lot of problems. Even when my bot have correct information that bet was placed, full bet information could arrive after some time (through order streaming api), in my tests I was forced to set this time to 1 second to block any other bot to make a bet operation after last time bet operation.

      And this is so wrong, because bot could work, so make bet operations in any new market update, so rest api is better in such uses case scenarios where your bot needs to make bet operations as quick as possible.

      The problem with betfair is that they implement api, but they do not actually use it, because otherwise their api implementation would be optimized on any use case scenario.






      ,

      Comment

      Working...
      X