Feck N. Eejit Auto Drip Feeding Bot

Feck N. Eejit posted at betfair forum interesting article about an automated drip feeder bot:

Given all that, you'd think if you wanted to place a bet there'd be all sorts of aids to assist you, particularly if your bet was sizeable. Alas no. There's no automatic or even voluntary drip-feeder. All you can do is stick up your sizeable bet knowing it will only be accepted if it's a non-trier or the price is about to drift as otherwise it will probably act as a book end. Instead you try to introduce your grand @ 20.0 in £50 blocks. A lengthy process that few have the patience for. All betfair need do is add a 'Remainder' field to the record of each bet in the queue. If the bet takes out more than a certain amount (depends on the market and time to off) the amount required to take out that amount is added to the queue and the remainder of the stake is entered in the Remainder field. Once the whole of the first bet is matched a new bet of the same size is appended to the queue, the Remainder field reduced and so on until it is all matched or the remainder of the bet is cancelled or edited. That would mean e.g. you could request a grand at 6.0 on an early market without freaking the market and you might even get it matched instantly if someone had done the same on the lay side.

The bot implementation

My implementation uses the PlaceBet bot, the bot already built-in in any bfexplorer application, so the AutoDripFeedingBot code is very simple just 6 lines of code in the BotJobDone method. The PlaceBet bot is responsible for bet placing, our bot AutoDripFeedingBot only checks if the total stake was already matched, if not the bot continues placing small bets in the preset odds range.

When setting the parameter PlaceBetAtBetterOdds to true, the bot places bets at better odds so offering them on the opposite odds, at this mode the bot uses the chase the price feature as well.

using BeloSoft.Betfair.Data;
using BeloSoft.Betfair.Trading;

namespace Bfexplorer.Scripting
{
  class AutoDripFeedingBot : PlaceBetBot
  {
    // Data
    private double totalAmountMatched;

    public AutoDripFeedingBot(IBetfairService betfairService,
        MonitoredMarket monitoredMarket, Runner runner)
      : base(betfairService, monitoredMarket, runner)
    {
      stopWhenBetPlaced = false;

      if (RunnerProperty.MinimalStake == 0)
      {
        AddMessage("Please set the MinimalStake (a total stake you want to match) if you want to run the bot.");
        Stop();
      }
    }

    protected override void BotJobDone()
    {
      base.BotJobDone();

      totalAmountMatched += RunnerProperty.Stake;

      if (totalAmountMatched >= RunnerProperty.MinimalStake)
      {
        AddMessage("Your total stake was matched.");

        Stop();
      }
      else
      {
        betPlaced = false;
        lastBetId = monitoredMarket.MyBets.GetLastBetId();
      }
    }
  }
}

How to run the bot

You can run this bot with the Bot Executor or with the Trade Opportunity Lookup Service when setting the bot criteria for this bot. Your bot full class name is:

  • Bfexplorer.Scripting.AutoDripFeedingBot

The bot parameters you can set are following:

  • BetType
  • MinimalOdds
  • MaximalOdds
  • PlaceBetAtBetterOdds
  • Stake (The feeding stake amount)
  • MinimalStake (The total stake to match)
  • AllowPlacingBetInPlay
  • AtInPlayCancelBet
  • StartBetPlaceFrom

You can download the source code here and the bot criteria settings to import into the Bot Executor here.

Happy bot coding!

Feck N. Eejit Auto Drip Feeding Bot running with Bfexplorer PRO


Do you want to comment this article? Sign up here or login.