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.
๐ 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
- Simulation - Test strategies with virtual balance (default)
- Live Main - Bet with your main balance
- 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
- CLI Guide - Complete command reference and examples
- User Guide - Strategy details and best practices
- Deployment Guide - Production deployment tips
๐ฏ 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!
- โ Start with simulation mode
- โ Use faucet balance before main balance
- โ Set stop-loss and take-profit limits
- โ Start with tiny bet amounts
- โ Monitor sessions carefully
- โ ๏ธ Martingale strategies are extremely risky
- โ ๏ธ No strategy guarantees profit
- โ ๏ธ 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 profileshistory.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
- Quick Start Guide - Get up and running in 5 minutes
- Complete Features - Full feature documentation
- Windows Build Guide - Building on Windows
- Install Guide - Detailed installation instructions
- Release Checklist - For developers
- Changelog - Version history
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
- Getting Started - Quick start guide for all interfaces
- User Guide - Complete user guide
- Deployment Guide - Production deployment instructions
Developer Documentation
- Tkinter GUI Enhancements - Desktop GUI new features
- NiceGUI Documentation - Web interface documentation
- Project Structure - Codebase organization
- Roadmap - Future plans and features
Build & Release
- Windows Build - Building for Windows
- Release Checklist - Release process
๐ค 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
- DuckDice: https://duckdice.io
- Bot API Documentation: https://duckdice.io/bot-api
- GitHub Repository: https://github.com/sushiomsky/duckdice-bot
- Latest Release: https://github.com/sushiomsky/duckdice-bot/releases/latest
- Issue Tracker: https://github.com/sushiomsky/duckdice-bot/issues
๐ Star History
If you find this project useful, please consider giving it a star! โญ
๐ฌ Support
- Issues: Report bugs via GitHub Issues
- Discussions: Join the conversation in Discussions
Made with โค๏ธ by the DuckDice Bot community
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a9127b9788781f4c3fccf80d42501092efbe14c72dd243ddb6eddf948573f0e
|
|
| MD5 |
360e1e09f5915d5a47506aafd67fb522
|
|
| BLAKE2b-256 |
dcca660a566b375e99e47abd1cb537e8f96eed02f7c824a41485e6b88c812bf2
|
File details
Details for the file duckdice_betbot-4.9.2-py3-none-any.whl.
File metadata
- Download URL: duckdice_betbot-4.9.2-py3-none-any.whl
- Upload date:
- Size: 79.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1465b322459af77e33e6bad8f858d46bf78bf80a72ed5dad005c8a199c7fcc95
|
|
| MD5 |
dd89efa720f09a50de1c4bdbd00472af
|
|
| BLAKE2b-256 |
14fae3ebf81e72f0d5ec0925d50d868ad1356c238d9da40df89a4bac684774b8
|