This repository provides simple CLI tools to place Binance USDT-M Futures orders (market and limit) and example advanced strategies (OCO simulation, TWAP, Grid scaffold).
Requirements
- Python 3.8+
- Install dependencies:
pip install -r requirements.txtAPI Setup
- Create a
.envfile in the repository root (or copy.env.sample) and set your Binance API key and secret:
BINANCE_API_KEY=your_api_key_here
BINANCE_API_SECRET=your_api_secret_here
BINANCE_TESTNET=True
Note: Set BINANCE_TESTNET=True to use the Binance Futures testnet endpoints by default while testing.
Usage examples
- Market order:
python src/market_orders.py BTCUSDT BUY 0.001 --simulate- Limit order:
python src/limit_orders.py BTCUSDT SELL 0.001 65000 --simulate- TWAP (split into slices):
python src/advanced/twap.py BTCUSDT BUY 0.01 --slices 6 --interval 30 --simulate- OCO (simulated):
python src/advanced/oco.py BTCUSDT BUY 0.01 70000 65000 --simulateLogging
- All actions, responses and errors are logged to
bot.login the project root.
Security
- Do not commit your real API keys. Use
.envand add it to.gitignore.
Limitations
- This project uses the public python-binance client and the Futures API. Some endpoints (like OCO) are not natively supported for Futures; OCO here is simulated by placing two orders and monitoring them.