Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Martingale Automation

A simple implementation of the Martingale betting strategy that automates bet placement using Stake's GraphQL API.

Disclaimer This project is intended for educational purposes only. It demonstrates how the Martingale strategy can be automated. Gambling involves significant financial risk, and this repository does not guarantee profit or encourage irresponsible gambling.


What is Martingale?

The Martingale strategy is a betting system where the stake is doubled after every loss, with the goal of recovering all previous losses plus making a profit equal to the original bet once a win occurs.

Example:

Round Bet Result
1 0.10 Lose
2 0.20 Lose
3 0.40 Lose
4 0.80 Win

After the win, the betting amount resets back to the default stake.


Features

  • Automated Dice betting
  • Automatic bet doubling after each loss
  • Resets to the default amount after every win
  • Configurable base bet
  • Stops after reaching the maximum consecutive loss threshold
  • Uses Stake's GraphQL API

Project Structure

.
├── src/
├── index.ts
├── package.json
├── tsconfig.json
└── README.md

Installation

git clone https://github.com/yourusername/martingale-automation.git

cd martingale-automation

npm install

Configuration

Inside index.ts, configure your authentication values.

const cookie = ``;

You will also need valid request headers such as:

  • Cookie
  • x-access-token
  • x-lockdown-token

These are obtained from your own authenticated browser session.


Running

Compile TypeScript

npx tsc

Run

node index.js

Or using ts-node

npx ts-node index.ts

Strategy Logic

Start with Default Bet
        │
        ▼
 Place Bet
        │
        ▼
 Win? ───────── Yes ─────────► Reset to Default Amount
  │
  No
  │
  ▼
 Double Bet
  │
  ▼
 Continue

The bot stops automatically after a predefined number of consecutive losses to prevent unlimited bankroll growth.


Configuration

const DEFAULT_AMOUNT = 0.1;

Maximum consecutive losses before stopping:

if (lossesInRow >= 13) process.exit(0);

Warning

The Martingale strategy does not eliminate risk.

A long losing streak can rapidly increase bet size and may exceed your available bankroll or platform betting limits.

Use at your own risk.


Tech Stack

  • TypeScript
  • Node.js
  • Axios
  • GraphQL

License

MIT

About

An automated implementation of the Martingale strategy with configurable bankroll, stake progression, and stop conditions (profit/loss thresholds).

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages