Skip to content

pathakvikash/binance_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Binance Futures Trading Bot (USDT-M Testnet)

A modular, asynchronous Python trading bot for Binance Futures (USDT-M Testnet), built with a clean architecture, strong logging, and extensibility in mind.


📌 Overview

This project provides a lightweight yet production-oriented foundation for building automated trading systems on Binance Futures. It emphasizes:

  • Clear separation of concerns
  • Async-first design
  • Safe testing using Binance Testnet
  • Scalable and maintainable code structure

✨ Features

  • ⚡ Async Binance Futures client (USDT-M)
  • 🧪 Testnet support (https://testnet.binancefuture.com)
  • 📈 Market & Limit order execution
  • 🖥️ CLI interface powered by click
  • 📊 Structured logging with configurable levels
  • ✅ Input validation for safer execution
  • 🔒 Environment-based configuration (.env)
  • 🧪 Dry-run mode for safe testing

📂 Project Structure

bot/
├── __init__.py
├── client.py            # Binance API wrapper (async, testnet-ready)
├── orders.py            # Order execution logic
├── validators.py        # Input validation
├── logging_config.py    # Logging setup
├── cli.py               # CLI entry point
├── README.md
└── requirements.txt

⚙️ Installation

1. Clone the repository

git clone <your-repo-url>
cd <your-project>

2. Create a virtual environment

python -m venv venv

# Linux / Mac
source venv/bin/activate

# Windows
venv\Scripts\activate

3. Install dependencies

pip install -r bot/requirements.txt

🔐 Environment Setup (Recommended)

Create a .env file in the project root:

BINANCE_API_KEY=your_api_key_here
BINANCE_API_SECRET=your_api_secret_here
BINANCE_TESTNET=true
LOG_LEVEL=INFO

⚠️ Never commit your .env file. Add it to .gitignore.


▶️ Usage

Run the CLI using module mode:

python -m bot.cli \
  --side BUY \
  --quantity 0.001

API credentials will be automatically loaded from .env.


📌 Examples

✅ Market Order

python -m bot.cli \
  --side BUY \
  --quantity 0.001

✅ Limit Order

python -m bot.cli \
  --side SELL \
  --order-type limit \
  --quantity 0.001 \
  --price 65000

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages