Skip to content

droderuan/binance-bot-trader

Repository files navigation

Binance Bot Trader

A cryptocurrency trading bot for Binance that supports multiple trading strategies and asset management.

Features

  • Multi-Strategy Trading: Run multiple trading strategies on different pairs simultaneously
  • Asset Management: Automatically detect and manage assets in your account
  • Optimal Trading: Convert assets to a common trading pair (e.g., USDT) for optimal trading
  • Position Tracking: Track positions, P&L, and account balance
  • Order Management: Create, track, and cancel orders

Asset Management

The bot includes a powerful asset management system that:

  1. Detects Assets: Automatically detects all assets in your account and their values
  2. Converts Assets: Converts assets to a common trading pair (e.g., USDT) for optimal trading
  3. Finds Conversion Paths: Determines the best path to convert between assets with minimal fees
  4. Tracks Balances: Keeps track of your balances and positions

How It Works

When the bot starts with asset management enabled:

  1. It detects all assets in your account
  2. Converts all non-stablecoin assets to your chosen common trading asset (e.g., USDT)
  3. Uses the common trading asset to execute trades based on strategy signals
  4. When selling, it converts the proceeds back to the common trading asset

This approach allows the bot to:

  • Take advantage of trading opportunities regardless of your current asset allocation
  • Minimize the number of assets you need to manage
  • Optimize for trading fees by using the most liquid pairs

Configuration

You can configure the bot in src/main.ts:

// Multi-coin configuration
export const multiCoinConfig = {
  pairs: ["BTCUSDT", "ETHUSDT", "BNBUSDT", "DOGEUSDT", "SOLUSDT"] as Pairs[],
  strategyConfig: strategyConfig,
  candleSize: env.candleInterval as CandleInterval,
  maxActivePairs: 3,
  updateInterval: 60000, // 1 minute
  startPosition: "EMPTY" as const,
  test: true,
  initialBalance: 1000, // 1000 USDT initial balance
  useAssetManager: true, // Enable asset manager
  commonTradingAsset: "USDT" // Use USDT as the common trading asset
};

Getting Started

  1. Clone the repository
  2. Install dependencies: npm install
  3. Configure your Binance API keys in .env
  4. Run the bot: npm start

License

MIT

About

Bot to automate trades at Binance based on strategies. Here you can use any pair to configure the bot.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published