top of page

The Official Blog

of SX Bet

Building a Betting Bot: Odds Maximizer Bot

Build an Odds Maximizer Betting Bot

In this section, you’ll put together the modules you have built to create the 'Odds Maximizer' betting bot. 

Step 1:  Build The Odds Maximizer Bot

The Odds Maximizer bot posts limit orders on your picks at a specified premium above the best available taker odds and dynamically adjusts your orders to maintain the premium while the market shifts, ensuring you never offer stale odds. Additionally, the bot monitors vigorish and liquidity, cancelling your orders if your set risk thresholds are exceeded.

Copy the following prompt to your clipboard and send it in a new conversation.

 

Be sure to attach the following standalone modules and files alongside the prompt. You can attach your own from Modules 1-6, or download them directly from GitHub ⬇️

Claude will hit the max length limit for a single response multiple times before completing the program. Type “Continue” to keep the chat going until the response is complete.

typecontinue.png

Step 2:  Create The Odds Maximizer Bot

1) Create a project folder to organize the code files. 

  1. Create a new folder for the bot on your desktop (or preferred location)

  2. Open Visual Studio Code.

  3. In the menu bar, select File > Open Folder.

  4. Select the folder you created

2) Create the project file structure

Claude should provide the file structure you need to create. Yours may differ from the screenshot below.

Create the file structure in Visual Studio Code.

3) Add the code to each file

Paste the code from Claude into each respective file you have created, saving them as you go:

  • Windows/Linux: Ctrl + s

  • Mac: Cmd + s

Add your private key, API key, and any other requested variables to the .env template

3) Install the required dependencies

Open the terminal and run the following command

Step 3: Test the Odds Maximizer Bot

See the FAQ, debugging, and common errors section below for more information.

1) Open the terminal, enter the following command and press enter:
2) Test order posting and cancellation

Create a position (use a premium of 50% or more to reduce the chance of getting undesired fills during testing)

 

Verify the following by checking your offered bets:

 

✅ Order was posted on the correct market and outcome 

✅ Odds match the premium for your position

✅ Order is for the correct amount of USDC

Close the position.

​✅ Verify your order was cancelled by checking if it still exists in your offered bets

3) Test maximum vig protection

1. Create a position (set the max vig to 0)

 

✅ Verify that no order was posted by checking your offered bets 

 

2. Close the position

4) Test minimum liquidity protection

1. Create a position (set the minimum liquidity threshold to 1000000000)

 

✅ Verify that no order was posted by checking your offered bets 

 

2. Close the position

5) Test market monitoring

1. Create a position and await a change in the best available taker odds

 

✅ Verify that your order is cancelled and re-posted at updated odds by checking your offered bets 

 

2. Close the position

6) Test fill monitoring

1. Create a position at competitive odds (e.g. 1-2% premium) and await a fill

 

✅ Verify that your bot records your fill and does not attempt to post additional orders once your maximum fill has been reached.

 

2. Close the position

7) Test minimum bet size for best available odds calculation

1. Find a market on SX Bet where the top order in the orderbook is for fewer USDC than those below it:

2. Create a position and set the minimum bet size for best available odds calculation to an amount greater than the best available offer. Using the screenshot above as an example, 250 USDC.

 

✅ Verify that the bot uses an order for more USDC than your minimum bet size for best odds calculation when posting your order

 

3. Close the position

8) Test minimum bet size for vig calculation

1. Find a market on SX Bet where the top order in the orderbook is for fewer USDC than those below it

 

2. Create a position and set the minimum bet size for vig calculation to an amount greater than the best available offer. 

 

✅Verify the bot is calculating the vig correctly by checking your active positions through the bot’s CLI menu

9) Test editing a position

1. Create a position

 

2. Select to view your active positions through the CLI menu

 

3. Edit the settings (e.g. premium)

 

✅ Verify that the bot updates your order to match the new premium

 

2. Close the position

Frequently Asked Questions

3-min.png
3-min.png
50-min.png
51-min.png
52-min.png
53-min.png
54-min.png
bottom of page