Betdelay

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jabe
    Senior Member
    • Dec 2014
    • 705

    #1

    Betdelay

    I know that there is a delay in placing a bet in-play on most events. I'm about to write my bet-related code and there's a couple of things I'm wondering about.

    The betDelay in marketBook gives the number of seconds for which an order is held before it is submitted.

    Let's assume betDelay = 5

    1. placeOrders: if I place an order, does it mean that there will be a 5+ second delay between my API call and any kind of response being returned? Or is there an immediate response even while the system waits to place the bet?

    2. If I want to change the odds on an existing bet, I need to use replaceOrders. ReplaceOrders cancels the original bet(s) and submits a new one(s). Does this mean there will be a 5+ second delay in placing the new order?

    3. I assume, since the responses to either call will have to tell me whether the placing/replacing was successful, that the time between the call being sent and a response being received will be at least 5 (or whatever) seconds. Is that correct?

    Thank you.
  • jptrader
    Junior Member
    • Nov 2009
    • 82

    #2
    1. Yes, a 5+ sec delay before a response.

    2. Yes, replaceOrders will also have the delay (if not, that would be a way to circumvent the delay). Cancelling an order is, however, not subject to the delay.

    3. Yes.

    Originally posted by jabe View Post
    I know that there is a delay in placing a bet in-play on most events. I'm about to write my bet-related code and there's a couple of things I'm wondering about.

    The betDelay in marketBook gives the number of seconds for which an order is held before it is submitted.

    Let's assume betDelay = 5

    1. placeOrders: if I place an order, does it mean that there will be a 5+ second delay between my API call and any kind of response being returned? Or is there an immediate response even while the system waits to place the bet?

    2. If I want to change the odds on an existing bet, I need to use replaceOrders. ReplaceOrders cancels the original bet(s) and submits a new one(s). Does this mean there will be a 5+ second delay in placing the new order?

    3. I assume, since the responses to either call will have to tell me whether the placing/replacing was successful, that the time between the call being sent and a response being received will be at least 5 (or whatever) seconds. Is that correct?

    Thank you.

    Comment

    • jabe
      Senior Member
      • Dec 2014
      • 705

      #3
      Thank you.

      Comment

      • jptrader
        Junior Member
        • Nov 2009
        • 82

        #4
        I see that Betfair plans to release "async bet placement" soon. Not sure how they intend that to work, but you may want to include this in your plans.

        Comment

        • jabe
          Senior Member
          • Dec 2014
          • 705

          #5
          Originally posted by jptrader View Post
          I see that Betfair plans to release "async bet placement" soon. Not sure how they intend that to work, but you may want to include this in your plans.
          Thanks, I noticed that too. I'm using VB.Net, so most of the program is async or timer driven. That's probably what's made it take so long to write!

          Comment

          • merecat_
            Junior Member
            • May 2009
            • 35

            #6
            "I see that Betfair plans to release "async bet placement" soon. Not sure how they intend that to work"

            Webhooks is one way, perhaps they will provide this.

            Comment

            • betdynamics
              Junior Member
              • Sep 2010
              • 534

              #7
              Async bet placement will mean that your call will return immediately with a bet reference (there will be no inplay delay).

              You will then need to determine if any of the bet is matched via other API calls.

              Note - your bet is still subject to the inplay delay, it's just that your main code is no longer held up waiting for a response.

              Comment

              • jabe
                Senior Member
                • Dec 2014
                • 705

                #8
                Thanks for the explanation. Handy to know.

                Comment

                • jptrader
                  Junior Member
                  • Nov 2009
                  • 82

                  #9
                  Betdynamics: That is interesting information, is this info you have from Betfair? If this is the case, I guess you would also need to determine if the bet is actually placed via other API calls, e.g. if a market goes suspended during the bet delay...



                  Originally posted by betdynamics View Post
                  Async bet placement will mean that your call will return immediately with a bet reference (there will be no inplay delay).

                  You will then need to determine if any of the bet is matched via other API calls.

                  Note - your bet is still subject to the inplay delay, it's just that your main code is no longer held up waiting for a response.

                  Comment

                  • betdynamics
                    Junior Member
                    • Sep 2010
                    • 534

                    #10
                    That is my understanding from discussions with Betfair, but it would be good to have confirmation from BDP.

                    I'm not sure what happens if the bet is "not placed". Perhaps it shows as cancelled. I'll seek clarification.

                    Comment

                    • jabe
                      Senior Member
                      • Dec 2014
                      • 705

                      #11
                      Originally posted by betdynamics View Post
                      That is my understanding from discussions with Betfair, but it would be good to have confirmation from BDP.

                      I'm not sure what happens if the bet is "not placed". Perhaps it shows as cancelled. I'll seek clarification.
                      What you've said makes a lot of sense. By the sound of it, the immediate response will either say, "Yes, accepted, and here's your betId(s)" or "No, here's your error code". At least that way if there is a problem you don't have to wait betDelay seconds to find out that it was rejected. In either case, we're soon going to be throwing requests in to find out how much got matched.

                      I wonder how market suspension in between acceptance and placement would work for markets that would need remaking.

                      Comment

                      • betdynamics
                        Junior Member
                        • Sep 2010
                        • 534

                        #12
                        Ok - after further discussion with Betfair, I need to correct/clarify my earlier statement.

                        It would appear that async bet placement will NOT return a BetId when the call is made.

                        Instead, it is expected that you will supply a CustomerRef as part of the bet placement call. You will then be able to use the CustomerRef to retrieve the current status of the bet via the standard listCurrentOrders call.

                        The response received when the bet is placed will re-iterate the bet delay so you know how long to wait in order to query the status of the bet.

                        Of course, this means that the CustomerRef will have to be persistent, which is another of the changes that are about to be implemented.

                        If the market suspends during the bet delay period (i.e. between the bet being placed and it hitting the exchange), then the bet will lapse.

                        Comment

                        • jabe
                          Senior Member
                          • Dec 2014
                          • 705

                          #13
                          Thanks for that. I assume with the current placeOrders call a bet will lapse on relevant markets under the same circumstances.

                          Comment

                          • jptrader
                            Junior Member
                            • Nov 2009
                            • 82

                            #14
                            Thanks for clearing that up! I hope this CustumerRef will be available from the order streaming API then, as that little detail would make this a really useful function.

                            Originally posted by betdynamics View Post
                            Ok - after further discussion with Betfair, I need to correct/clarify my earlier statement.

                            It would appear that async bet placement will NOT return a BetId when the call is made.

                            Instead, it is expected that you will supply a CustomerRef as part of the bet placement call. You will then be able to use the CustomerRef to retrieve the current status of the bet via the standard listCurrentOrders call.

                            The response received when the bet is placed will re-iterate the bet delay so you know how long to wait in order to query the status of the bet.

                            Of course, this means that the CustomerRef will have to be persistent, which is another of the changes that are about to be implemented.

                            If the market suspends during the bet delay period (i.e. between the bet being placed and it hitting the exchange), then the bet will lapse.

                            Comment

                            Working...
                            X