Extendible, customizable real-time arbitrage scanning and placing software
Surebet is an extendible and customizable real-time arbitrage scanning and placing software designed to help you find and place arbitrage bets across multiple bookmakers or sources. It supports various betting strategies, uses fuzzy string matching to identify matching events between sources, and is built for flexibility and scalability.
Surebet offers the following key features:
Feature | Description |
---|---|
Retriever Agnostic | Supports any retriever type (websockets, API calls, Selenium, Puppeteer, etc.) via a common interface. |
Multiple Sources/Bookies | Handles arbitrage opportunities across multiple bookmakers simultaneously. |
Customizable Arbers | Allows custom arbitrage strategies. Examples: H2H Arber, 1x2 Arber. |
Genetic Strategies | Built-in support for customizable genetic algorithms. See available strategies. |
Fiat Conversion | Includes fixed fiat-to-fiat conversion for betting across currencies. See money module. |
Fuzzy String Matching | Uses fuzzy string matching (via fuzzball.js) to identify similar events between bookmakers. |
Predefined Arbers | Includes predefined strategies for markets like H2H (tennis, MMA) and 1x2 (soccer). |
To get started with Surebet, clone the repository and install the necessary dependencies:
git clone https://github.com/danielcardeenas/surebet.git
cd surebet
npm install
Here's how to use Surebet for basic H2H arbitrage betting:
-
Import the required modules:
import { H2HArber } from '@arbers'; import { Betfair, Bookmaker } from '@bookies'; import { money } from '@money/currencies';
-
Create instances of your bookmakers:
const [betfair, bookmaker] = await Promise.all([ Betfair.instance({ headless: false }, money.USD), Bookmaker.instance({ headless: false }, money.USD), ]);
-
Login to the bookmaker accounts:
await betfair.login({ user: 'yourUsername', password: 'yourPassword' });
-
Define retrievers to fetch live betting opportunities:
const retrievers = [ { bookie: betfair, retriever: () => betfair.repo().live.tennis.h2h({ include: ['back'] }), }, { bookie: bookmaker, retriever: () => bookmaker.repo().live.tennis.h2h(), }, ];
-
Start the arbitrage process:
const investment = { amount: 200, currency: money.USD }; const tennisArber = new H2HArber(retrievers, investment); tennisArber.start(); // Listen for the close event tennisArber.closed.pipe(take(1)).subscribe(() => { process.exit(0); });
The following example demonstrates Surebet's output when identifying arbitrage opportunities:
Surebet supports custom arbitrage strategies. You can implement your own by extending the base Arber
class. Examples of predefined arbers include:
To create a custom arber:
- Extend the base
Arber
class. - Implement your strategy logic based on your requirements.
Retrievers are responsible for fetching live betting opportunities from sources or bookmakers. Surebet supports retrievers from various sources, such as APIs, websockets, or browser automation tools like Puppeteer.
To create a custom retriever:
- Implement a retriever function that conforms to the common interface.
- Use the retriever in your arber setup.
Example retriever for a custom source:
const customRetriever = {
bookie: customBookieInstance,
retriever: () => customBookieInstance.repo().live.soccer.h2h(),
};
To build and run the project, use the following commands:
# Build the project
npm run build
# Run tests (optional)
npm test
# Start the application
npm start
Surebet is licensed under the MIT License. Feel free to use, modify, and distribute the software as per the license terms.
For more details, visit the Surebet Repository.