Thanks to visit codestin.com
Credit goes to github.com

Skip to content

codez0mb1e/BinanceBot

Repository files navigation

Market Bot for Binance

Contributors Welcome GitHub license

Naive Market Maker Bot for Binance exchange.

Solution contains two console projects:

  • The BinanceBot.MarketViewer.Console project: Order book updating in near-real time (via Binance WebSocket API).
  • The BinanceBot.MarketBot.Console project: Create and cancel orders (via Binance REST API) depends on current Market Depth.

alt text

In picture below BinanceBot create order to Order Book only if price spread by ETH/BTC greater than 0.2%.

Warn: BinanceBot uses test order create API by default (without real order creation). Turn off TEST_ORDER_CREATION_MODE compilation symbol in MarketMakerBot.cs to create real order in order book.

Requirements

  • .NET 9.0
  • Binance Account.

Setup Instructions

Setting up API Credentials

Both console applications (BinanceBot.MarketBot.Console and BinanceBot.MarketViewer.Console) now support environment variables for API credentials using .env files.

  1. Copy the example file:

    # For MarketBot
    cp src/BinanceBot.MarketBot.Console/.env.example src/BinanceBot.MarketBot.Console/.env
    
    # For MarketViewer
    cp src/BinanceBot.MarketViewer.Console/.env.example src/BinanceBot.MarketViewer.Console/.env
  2. Edit the .env file with your actual Binance API credentials:

    BINANCE_API_KEY=your_actual_api_key_here
    BINANCE_SECRET=your_actual_secret_key_here
  3. Run the application - it will automatically load the credentials from the .env file.

⚠️ Never commit/share your .env file to version control! It contains sensitive credentials.

References

  1. Binance official API docs.
  2. Official C# Wrapper for the Binance exchange API.

Contributors 2

  •  
  •  

Languages