A CLI application for placing market and limit orders on the Binance Futures Testnet.
- Python 3.12+
- A Binance Futures Testnet account
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtpython cli.pyOn first run you'll be prompted for your API credentials and walked through a
setup wizard. Credentials are saved to .env and never hardcoded.
Once configured, the menu lets you place market and limit orders interactively.
trading_bot/
├── bot/
│ ├── client.py # Futures REST client
│ ├── config.py # Environment settings
│ ├── orders.py # Order functions + OrderResponse
│ ├── validators.py # Input validation
│ ├── wizard.py # Credential setup wizard
│ ├── app.py # Menu-driven application
│ ├── prompts.py # Interactive input prompts
│ └── logging_config.py # Logging setup
├── cli.py # Entry point
├── logs/trading.log
└── .env.example
from decimal import Decimal
from bot.config import Settings
from bot.client import BinanceClient
from bot.orders import create_market_order
settings = Settings()
client = BinanceClient(settings)
client.connect()
resp = create_market_order(client, "BTCUSDT", "BUY", Decimal("0.01"))
if resp.success:
print(f"Order ID: {resp.order_id}")
client.close()Logs rotate at 10 MB and keep 5 backups. Written to logs/trading.log.