This repository contains a Solana trading bot for pump.fun and letsbonk.fun platforms. When working on the project interactively with an agent (e.g. the Codex CLI) please follow the guidelines below for safe development and testing.
- Always test with learning examples first in
learning-examples/before modifying the main bot. - Do not run the main bot with real funds during agent development sessions.
- Test all changes using manual buy/sell scripts with minimal amounts before production use.
- Use testnet or paper trading when available to validate logic.
If you add or update dependencies:
- Use
uv add <package>to add new dependencies. - The
uv.lockfile will be automatically updated. - Restart any running bots after dependency changes.
- Verify compatibility with Python 3.9+ as specified in the project.
- Follow Ruff linting rules defined in
pyproject.toml. - Use Google-style docstrings for functions and classes.
- Include type hints for all public functions.
- Use the centralized logger:
from src.utils.logger import get_logger. - Keep line length to 88 characters (auto-formatted).
- Use double quotes for strings.
Before completing any task, run these quality checks:
| Command | Purpose |
|---|---|
ruff format |
Format code to project standards |
ruff check |
Run linting checks |
ruff check --fix |
Auto-fix linting issues where possible |
Test changes progressively:
-
Unit testing: Use individual learning examples
uv run learning-examples/fetch_price.py
-
Integration testing: Test specific listeners
uv run learning-examples/listen-new-tokens/listen_logsubscribe.py
-
Configuration testing: Validate YAML configs before running
# Check syntax and required fields manually -
Dry run: Use minimal amounts and conservative settings first
Never commit sensitive data:
- Keep private keys in
.envfile (git-ignored). - Use separate
.envfiles for development and production. - Required environment variables:
SOLANA_RPC_WEBSOCKET=wss://... SOLANA_RPC_HTTP=https://... PRIVATE_KEY=your_private_key_here
- Edit YAML files in
bots/directory for bot instances. - Start with conservative settings:
- Low
buy_amount - High
min_sol_balance - Strict filters
- Low
- Test one bot instance at a time during development.
- Monitor logs in
logs/directory for debugging.
When adding features:
- Check platform compatibility (
pump_funvslets_bonk). - Test with both platforms if changes affect core logic.
- Update platform-specific implementations in
src/platforms/. - Verify IDL files match the on-chain programs.
- Never expose private keys in code, logs, or commits.
- Test with minimal amounts first.
- Verify transactions on Solana explorer before scaling up.
- Monitor rate limits of your RPC provider.
- Keep logs for audit and debugging purposes.
| Command | Purpose |
|---|---|
uv sync |
Install/update dependencies |
source .venv/bin/activate |
Activate virtual environment |
uv pip install -e . |
Install bot as editable package |
pump_bot |
Run the main bot |
uv run learning-examples/manual_buy.py |
Test manual buy |
uv run learning-examples/manual_sell.py |
Test manual sell |
Following these practices ensures safe development, prevents accidental trades, and maintains code quality. Always prioritize testing and security when working with trading bots.