Skip to main content

DuckDice betting bot with 18 strategies, Monte Carlo simulation, and comprehensive CLI

Project description

๐ŸŽฒ DuckDice Bot - Command Line Edition

Professional automated betting toolkit for DuckDice.io

A comprehensive command-line toolkit for the DuckDice Bot API. Automate betting strategies, test in simulation mode, and manage your gaming responsibly with a powerful CLI interface.

License: MIT Python 3.9+ Platform

๐Ÿš€ Quick Start

Installation

# Clone the repository
git clone https://github.com/sushiomsky/duckdice-bot.git
cd duckdice-bot

# Install dependencies
pip install -r requirements.txt

# Make CLI executable (Unix/macOS)
chmod +x duckdice_cli.py

Your First Run - Simulation Mode

# Test a strategy risk-free in simulation mode
python3 duckdice_cli.py run \
  --mode simulation \
  --strategy classic-martingale \
  --currency btc \
  --max-bets 100

Live Betting (Get API Key from DuckDice)

# Bet with main balance
python3 duckdice_cli.py run \
  --mode live-main \
  --strategy fibonacci \
  --currency btc \
  --api-key YOUR_API_KEY \
  --max-bets 50

# Bet with faucet balance
python3 duckdice_cli.py run \
  --mode live-faucet \
  --strategy faucet-grind \
  --currency doge \
  --api-key YOUR_API_KEY

Get your API key from DuckDice โ†’ Account Settings โ†’ Bot API

โœจ Features

๐ŸŽฏ Core Capabilities

  • 18 Built-in Strategies - From conservative to aggressive
  • Beautiful Terminal UI - Colors, progress bars, live stats โญ NEW
  • Simulation Mode - Test risk-free with virtual balance
  • Live Betting - Real betting with main or faucet balance
  • Interactive Mode - Guided setup, zero configuration needed
  • Profile Management - Save and reuse configurations
  • Risk Controls - Stop-loss, take-profit, max bets/losses
  • Session History - SQLite database tracks all bets
  • Real-time Stats - Live progress tracking and statistics

๐ŸŽฎ Three Betting Modes

  1. Simulation - Test strategies with virtual balance (default)
  2. Live Main - Bet with your main balance
  3. Live Faucet - Bet with faucet balance (perfect for testing)

๐ŸŽฒ Available Strategies

Conservative (Low Risk)

  • dalembert - Increase/decrease bets gradually
  • oscars-grind - Target small consistent profits
  • one-three-two-six - Fixed sequence, controlled risk

Moderate Risk

  • fibonacci - Follow Fibonacci sequence
  • labouchere - Cancellation system
  • paroli - Reverse martingale with limits

Aggressive (High Risk)

  • classic-martingale - Double on loss (โš ๏ธ requires large bankroll)
  • anti-martingale-streak - Multiply on wins
  • streak-hunter - Win streak amplifier (NEW)
  • fib-loss-cluster - Fibonacci on loss streaks

Specialized

  • faucet-grind - Optimized for faucet betting
  • faucet-cashout - USD-targeted staged growth
  • kelly-capped - Kelly criterion with safety caps
  • target-aware - State machine with profit targets
  • range50-random - Range dice at 50% chance
  • max-wager-flow - Maximize wagering throughput
  • rng-analysis-strategy - RNG pattern analysis (educational)
  • custom-script - Load your own Python strategy

๐Ÿ“– Documentation

๐ŸŽฏ Command Overview

List Available Strategies

python3 duckdice_cli.py strategies

Run a Strategy

# Interactive mode (prompts for all options)
python3 duckdice_cli.py run

# With arguments
python3 duckdice_cli.py run \
  --mode simulation \
  --strategy dalembert \
  --currency btc \
  --max-bets 100 \
  --stop-loss -0.2 \
  --take-profit 0.5

Save Strategy Profile

# Interactive configuration
python3 duckdice_cli.py save-profile my-strategy --strategy fibonacci

# Use saved profile
python3 duckdice_cli.py run --profile my-strategy --mode simulation

List Saved Profiles

python3 duckdice_cli.py profiles

Configure Defaults

# View configuration
python3 duckdice_cli.py config

# Set default values
python3 duckdice_cli.py config --set default_currency=doge
python3 duckdice_cli.py config --set api_key=YOUR_KEY

๐Ÿ›ก๏ธ Risk Management

Built-in Safety Controls

# Stop at -20% loss
--stop-loss -0.2

# Stop at +50% profit
--take-profit 0.5

# Limit total bets
--max-bets 100

# Stop after N losses in a row
--max-losses 5

# Time limit (seconds)
--max-duration 3600

Example: Conservative Betting

python3 duckdice_cli.py run \
  --mode simulation \
  --strategy dalembert \
  --currency btc \
  --max-bets 500 \
  --stop-loss -0.1 \
  --take-profit 0.2 \
  --max-losses 3

๐Ÿ“Š Session History

All bets are saved to ~/.duckdice/history.db (SQLite database)

Query Your Data

sqlite3 ~/.duckdice/history.db

# Recent sessions
SELECT session_id, strategy, profit 
FROM sessions 
ORDER BY started_at DESC 
LIMIT 10;

# Win rate by strategy
SELECT strategy, 
       CAST(SUM(won) AS FLOAT) / COUNT(*) * 100 as win_rate
FROM bet_history 
GROUP BY strategy;

๐Ÿ”ง Advanced Usage

Batch Testing

# Test multiple strategies
for strategy in dalembert fibonacci oscars-grind; do
  python3 duckdice_cli.py run \
    -m simulation \
    -s $strategy \
    --max-bets 100
done

Custom Strategy

Create your own strategy script and use it:

python3 duckdice_cli.py run \
  --strategy custom-script \
  --mode simulation

โš ๏ธ Safety Tips

IMPORTANT: Always test in simulation mode first!

  1. โœ… Start with simulation mode
  2. โœ… Use faucet balance before main balance
  3. โœ… Set stop-loss and take-profit limits
  4. โœ… Start with tiny bet amounts
  5. โœ… Monitor sessions carefully
  6. โš ๏ธ Martingale strategies are extremely risky
  7. โš ๏ธ No strategy guarantees profit
  8. โš ๏ธ Only bet what you can afford to lose

๐Ÿ› ๏ธ Development

Project Structure

duckdice-bot/
โ”œโ”€โ”€ duckdice_cli.py          # Main CLI entry point
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ betbot_strategies/   # 17 betting strategies
โ”‚   โ”œโ”€โ”€ betbot_engine/       # Core betting engine
โ”‚   โ”œโ”€โ”€ duckdice_api/        # API client
โ”‚   โ””โ”€โ”€ simulation_engine.py # Offline simulator
โ”œโ”€โ”€ tests/                   # Test suite
โ””โ”€โ”€ docs/                    # Documentation

Run Tests

python3 -m pytest tests/

๐Ÿ“ Configuration Files

All stored in ~/.duckdice/:

  • config.json - Default settings (API key, currency, mode)
  • profiles.json - Saved strategy profiles
  • history.db - SQLite database with all bets

๐Ÿค Contributing

Contributions welcome! Please read CONTRIBUTING.md first.

๐Ÿ“„ License

MIT License - see LICENSE for details

โšก Changelog

See CHANGELOG.md for version history

๐Ÿ™ Acknowledgments

  • DuckDice.io for providing the Bot API
  • Community contributors and testers

Disclaimer: Gambling involves risk. This tool is for educational and entertainment purposes. Always gamble responsibly and within your means. The developers are not responsible for any losses incurred while using this software.

๐Ÿ“š Documentation

Strategy Guides

๐Ÿ”ง Advanced Usage

Custom Strategies

Create your own betting strategies with the built-in editor:

# Example custom strategy
def calculate_next_bet(last_bet, won, balance):
    if won:
        return last_bet * 0.5  # Reduce on win
    else:
        return last_bet * 2.0  # Double on loss

Features:

  • Monaco editor with syntax highlighting
  • Real-time validation
  • Template library
  • Version history (auto-save last 10 versions)
  • One-click formatting

API Integration

from duckdice import DuckDiceAPI

api = DuckDiceAPI("your-api-key")
result = api.bet(amount=0.00001, target=50.5, currency="btc")
print(f"Result: {result.profit} {result.currency}")

๐Ÿ—๏ธ Building from Source

Requirements

  • Python 3.9 or higher
  • pip (Python package manager)
  • Virtual environment (recommended)

Build Executable

# Install build dependencies
pip install -r requirements-build.txt

# Build for your platform
./build_release.sh  # Linux/macOS
build_windows.bat   # Windows

# Output in dist/ directory

Running Tests

# Run all tests
python -m pytest tests/

# Run specific test
python -m pytest tests/test_strategies.py

๐Ÿ“š Documentation

User Documentation

Developer Documentation

Build & Release

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

See CONTRIBUTING.md for detailed guidelines.

Development Setup

# Fork and clone
git clone https://github.com/yourusername/duckdice-bot.git
cd duckdice-bot

# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Install dev dependencies
pip install -r requirements.txt
pip install -r requirements-build.txt

# Run tests
python -m pytest

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

โš ๏ธ Disclaimer

This bot is for educational and entertainment purposes only. Gambling involves risk, and you should never bet more than you can afford to lose. The authors are not responsible for any financial losses incurred through the use of this software.

Please gamble responsibly.

๐Ÿ”— Links

๐ŸŒŸ Star History

If you find this project useful, please consider giving it a star! โญ

๐Ÿ’ฌ Support


Made with โค๏ธ by the DuckDice Bot community

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

duckdice_betbot-4.9.2.tar.gz (72.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

duckdice_betbot-4.9.2-py3-none-any.whl (79.8 kB view details)

Uploaded Python 3

File details

Details for the file duckdice_betbot-4.9.2.tar.gz.

File metadata

  • Download URL: duckdice_betbot-4.9.2.tar.gz
  • Upload date:
  • Size: 72.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for duckdice_betbot-4.9.2.tar.gz
Algorithm Hash digest
SHA256 7a9127b9788781f4c3fccf80d42501092efbe14c72dd243ddb6eddf948573f0e
MD5 360e1e09f5915d5a47506aafd67fb522
BLAKE2b-256 dcca660a566b375e99e47abd1cb537e8f96eed02f7c824a41485e6b88c812bf2

See more details on using hashes here.

File details

Details for the file duckdice_betbot-4.9.2-py3-none-any.whl.

File metadata

File hashes

Hashes for duckdice_betbot-4.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1465b322459af77e33e6bad8f858d46bf78bf80a72ed5dad005c8a199c7fcc95
MD5 dd89efa720f09a50de1c4bdbd00472af
BLAKE2b-256 14fae3ebf81e72f0d5ec0925d50d868ad1356c238d9da40df89a4bac684774b8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page