Naive Market Maker Bot for Binance exchange.
Solution contains two console projects:
- The
BinanceBot.MarketViewer.Consoleproject: Order book updating in near-real time (via Binance WebSocket API). - The
BinanceBot.MarketBot.Consoleproject: Create and cancel orders (via Binance REST API) depends on current Market Depth.
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.
- .NET 9.0
- Binance Account.
Both console applications (BinanceBot.MarketBot.Console and BinanceBot.MarketViewer.Console) now support environment variables for API credentials using .env files.
-
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
-
Edit the
.envfile with your actual Binance API credentials:BINANCE_API_KEY=your_actual_api_key_here BINANCE_SECRET=your_actual_secret_key_here
-
Run the application - it will automatically load the credentials from the
.envfile.
.env file to version control! It contains sensitive credentials.
