About BaseBot
🎯 Purpose
BaseBot is a proof-of-concept trading platform designed for crypto traders who want full control over their strategies. Built with Python, it provides a solid foundation for custom trading bot development.
🏗️ Modular Architecture
Every component is pluggable. Add new strategies, data sources, and execution venues without touching core code. The plugin system makes extensibility straightforward.
🔗 Multi-Exchange Support
Connect to Coinbase (CEX) and multiple DEXs including 0x, 1inch, Uniswap, CowSwap, Sushi, Curve, dYdX, Carbon, and Raydium.
🛡️ Risk Management
Built-in checks for position limits and drawdowns keep your trading within safe parameters.
📊 Backtesting
Test your strategies against historical data before risking real capital.
🖥️ Web Interface
Monitor your bot through a lightweight Flask-based dashboard with real-time metrics and charts.
Named after Bandit, a clever black and white tuxedo cat known for finding opportunities where others saw none. Like its namesake, BaseBot is designed to be quick, adaptable, and always ready for the next move.
Pricing
Choose the plan that fits your trading needs
Student
- 1,000 trades/month
- $1,000 AUM
- ✓ Self-hosted only
- ✓ Full source code
- ✓ Community support
- ✓ Basic strategies
Starter
- 5,000 trades/month
- $5,000 AUM
- ✓ Managed hosting
- ✓ Email support
- ✓ All strategies
- ✓ Auto backups
Indie Developer
- 25,000 trades/month
- $25,000 AUM
- ✓ Priority support
- ✓ Advanced strategies
- ✓ Real-time monitoring
- ✓ Custom plugins
Hobbyist
- 100,000 trades/month
- $100,000 AUM
- ✓ 99.9% uptime SLA
- ✓ ML strategies
- ✓ API access
- ✓ Webhooks
Small Business
- 500,000 trades/month
- $500,000 AUM
- ✓ Multi-user access
- ✓ Dedicated support
- ✓ Custom integrations
- ✓ Advanced analytics
Mid-Business
- 2,500,000 trades/month
- $2.5M AUM
- ✓ Dedicated infrastructure
- ✓ 24/7 support
- ✓ White-label options
- ✓ Custom strategies
Enterprise
- 10,000,000 trades/month
- $10M AUM
- ✓ Enterprise SLA
- ✓ Compliance support
- ✓ Training & onboarding
- ✓ Dedicated account manager
Custom
- Unlimited trades
- Unlimited AUM
- ✓ Bespoke solutions
- ✓ Custom development
- ✓ On-premise options
- ✓ Everything you need
💡 Open Source Forever: BaseBot's core will always remain free and open source. Paid plans help fund development and infrastructure costs.
Management Fee Structure
Fair, transparent fees that scale with your success
Performance Fee
of realized profits only
- ✓ Only charged on winning trades
- ✓ No fees on losses
- ✓ High-water mark protection
- ✓ Monthly settlement
Management Fee
annual AUM fee (0.042% monthly)
- ✓ Covers infrastructure costs
- ✓ 24/7 monitoring included
- ✓ Automatic backups
- ✓ Platform updates
Transaction Fee
per trade execution
- ✓ Covers DEX/CEX gas costs
- ✓ Bulk discounts available
- ✓ Capped at tier limits
- ✓ Transparent pricing
Example Calculation (Hobbyist Tier)
Note: Student tier has no performance or management fees. Transaction fees apply to all hosted tiers. Self-hosted deployments have no platform fees.
How to Use BaseBot
1. Clone and Setup
git clone https://github.com/afterdarksys/banditbot.git
cd banditbot
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
2. Configuration
Copy the example configuration and set your environment variables:
cp config/dex_config.example.json config/dex_config.json
Create a .env file or set environment variables for your API keys and settings. See the Configuration section for details.
3. Initialize Database
python scripts/init_db.py
4. Run the Web Interface
python botapp/app.py
Visit http://localhost:5000 to see your dashboard.
5. Use CLI Tools
python -m tradingbot.cli.main --help
python -m tradingbot.cli.main dex-quote --provider 0x
6. Run Tests
python -m unittest -v
Trading Strategies
BaseBot comes with example strategies and makes it easy to create your own.
Built-in Strategies
- Gamma Edge: Option skew-based strategy for identifying edge opportunities
- Indicator ML: Machine learning-powered technical indicator strategy
Strategy System
All strategies inherit from the IStrategy interface and are automatically discovered by the plugin loader. Strategies generate signals based on market data, which are then evaluated by the risk management system before execution.
Backtesting Your Strategies
Test strategies against historical data to evaluate performance before live trading:
PYTHONPATH=src python3 scripts/benchmark.py
Configuration
Configure BaseBot using environment variables or a .env file.
Core Settings
TB_DB_URL=sqlite:///tradingbot.db
TB_API_TOKEN=your_secure_token
TB_WEB_USER=admin
TB_WEB_PASS=secure_password
Coinbase (CEX)
TB_COINBASE_API_KEY=...
TB_COINBASE_API_SECRET=...
TB_COINBASE_API_PASSPHRASE=...
TB_COINBASE_API_TYPE=exchange
TB_COINBASE_JWT=...
RPC Providers
TB_INFURA_API_KEY=...
TB_INFURA_ENABLED=yes
TB_QUICKNODE_API_KEY=...
TB_QUICKNODE_ENABLED=yes
DEX Integrations
Each DEX can be configured with API keys and enabled/disabled individually:
TB_0X_API_KEY=...
TB_0X_BASE_URL=https://api.0x.org
TB_0X_ENABLED=yes
TB_1INCH_API_KEY=...
TB_1INCH_BASE_URL=https://api.1inch.dev
TB_1INCH_ENABLED=yes
TB_UNISWAP_API_KEY=...
TB_UNISWAP_ENABLED=yes
TB_COWSWAP_BASE_URL=https://api.cow.fi
TB_COWSWAP_ENABLED=may
TB_SUSHI_BASE_URL=https://api.sushi.com/swap/v7
TB_SUSHI_ENABLED=may
TB_CURVE_BASE_URL=https://api.curve.finance/v1
TB_CURVE_ENABLED=may
TB_DYDX_BASE_URL=https://indexer.dydx.trade/v4
TB_DYDX_ENABLED=may
TB_CARBON_BASE_URL=...
TB_CARBON_ENABLED=may
TB_RAYDIUM_BASE_URL=https://transaction-v1.raydium.io
TB_RAYDIUM_ENABLED=may
Note: ENABLED values: yes (required), no (disabled), may (optional)
DEX Configuration File
Edit config/dex_config.json for blockchain-specific settings:
{
"eth_rpc_url": "https://...",
"solana_rpc_url": "https://...",
"keys": {
"0x": "api_key",
"1inch": "api_key",
"uniswap": "api_key",
"evm_private_key": "0x...",
"solana_private_key": "..."
},
"enable": {
"0x": "yes",
"1inch": "yes",
"uniswap": "may"
}
}
Writing Plugins
Extend BaseBot with custom strategies and chain adapters using the plugin system.
Plugin Types
- Strategies: Implement
IStrategyto create trading signals - Chain Adapters: Implement
IChainAdapterto add DEX/CEX support
Creating a Strategy Plugin
Create a new file in src/tradingbot/plugins/strategies/:
from typing import Dict, Any, Optional
from tradingbot.interfaces.plugin import IStrategy
class MyCustomStrategy(IStrategy):
@property
def name(self) -> str:
return "my_custom_strategy"
@property
def version(self) -> str:
return "1.0.0"
def initialize(self, config: Dict[str, Any]) -> None:
# Initialize your strategy with config
self.threshold = config.get("threshold", 0.5)
def generate_signal(self, market_data: Dict[str, Any]) -> Optional[Dict[str, Any]]:
# Your strategy logic here
# Return a signal dict or None
if self._should_buy(market_data):
return {
"signal": "BUY",
"confidence": 0.8,
"reason": "Custom indicator triggered"
}
return {"signal": "HOLD", "confidence": 0.0}
def _should_buy(self, data: Dict[str, Any]) -> bool:
# Your analysis logic
return False
Creating a Chain Adapter Plugin
Create a new file in src/tradingbot/plugins/chains/:
from typing import Dict, Any
from tradingbot.interfaces.plugin import IChainAdapter
class MyDexAdapter(IChainAdapter):
@property
def name(self) -> str:
return "my_dex"
@property
def version(self) -> str:
return "1.0.0"
def initialize(self, config: Dict[str, Any]) -> None:
self.api_key = config.get("api_key")
self.base_url = config.get("base_url")
def get_quote(self, params: Dict[str, Any]) -> Dict[str, Any]:
# Fetch price quote from your DEX
# params: {"from": "ETH", "to": "USDC", "amount": 1.0}
return {
"price": 2000.0,
"estimated_gas": 21000
}
def execute_swap(self, params: Dict[str, Any]) -> Dict[str, Any]:
# Execute the swap
return {
"tx_hash": "0x...",
"status": "pending"
}
Plugin Discovery
Plugins are automatically discovered by the PluginLoader. Once you create a plugin file in the appropriate directory, it will be available to the system without any additional registration.
# List available strategies
from tradingbot.plugins.loader import PluginLoader
loader = PluginLoader()
loader.discover_plugins()
print(loader.list_strategies())
print(loader.list_chains())
Giving Back
BaseBot is open source and thrives on community contributions.
🐛 Report Issues
Found a bug or have a feature request? Open an issue on GitHub. Clear bug reports with reproducible steps help us fix problems quickly.
💻 Contribute Code
Fork the repository, create a feature branch, and submit a pull request. Make sure tests pass before submitting.
git checkout -b feature/my-feature
# Make your changes
python -m unittest -v
git commit -m "Add my feature"
git push origin feature/my-feature
📚 Improve Documentation
Help others understand BaseBot better. Documentation improvements, tutorials, and examples are always welcome.
🔌 Share Plugins
Created a useful strategy or chain adapter? Share it with the community! Submit it as a PR or create a separate plugin repository.
⭐ Spread the Word
Star the repository on GitHub, share it with other traders, and help grow the community.
✅ Code Standards
Follow PEP 8 guidelines, use meaningful names, and add comments where necessary. Quality over quantity.
Ready to Contribute?
Visit GitHub RepositorySupport BaseBot Development
We are accepting donations to fund development of the open source project and to cover infrastructure costs for our free services. Our expenses are around $30k/year to operate this service.
This project was created when I wasn't working for two years. I am a disabled developer trying to make it and welcome your support. Thank you.
Donate to:
1JKWmsY3PVG3fb3vzURvt4gVRN2F2PBmSg
EFafwr3F5yVLX3dr4t6DYWMZ6XwaWJrgJ7WViQkHtQUV
0xd8148FbBCD5C1ca4B303367C96fdFA1F0B59e720
Every contribution helps keep BaseBot free and open source. Thank you for your support! 🙏