Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Binance Futures Testnet Trading Bot

A CLI application for placing market and limit orders on the Binance Futures Testnet.

Quick Start

Prerequisites

Setup

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Running

python cli.py

On 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.

Project Structure

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

Programmatic Usage

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()

Logging

Logs rotate at 10 MB and keep 5 backups. Written to logs/trading.log.

About

Bring your own key....

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages