Binance DCA Bot is an open-source tool for automated Dollar-Cost Averaging (DCA) trading on Binance. This bot is designed to simplify cryptocurrency investments by automating periodic purchases of your target assets.
- Automated DCA Orders: Automatically place market buy orders for your target assets at predefined intervals.
- Balance Monitoring: Monitors your Binance account balance and sends warnings when the balance drops below a specified threshold.
- Configurable Notifications: Sends order failure and low-balance notifications through Bark, Telegram, or multiple channels.
- AWS Parameter Store Support: Fetches configuration parameters securely from AWS Parameter Store.
- Go (version 1.20 or later)
- A Binance account with API key and secret
- A Bark key or Telegram bot for notifications
- AWS account with access to Parameter Store
- AWS SDK for Go
-
Clone the repository:
git clone https://github.com/yourusername/binance-dca-bot-go.git cd binance-dca-bot-go -
Set up AWS Parameter Store with the required parameters:
/myapp/bark/key/myapp/binance/apiKey/myapp/binance/apiSecret
-
Build the binary:
go build -o binance-dca-bot ./cmd/main.go
-
Run the bot:
./binance-dca-bot
For local testing, create personal config files from the checked-in examples:
cp local_config.example.json local_config.json
cp local_event.example.json local_event.jsonThen fill local_config.json with your local secret values. The real local JSON files are ignored by Git.
Configuration is managed through AWS Parameter Store. Ensure that the following parameters are set in your AWS account:
| Parameter Name | Description |
|---|---|
/myapp/bark/key |
Your Bark key for notifications. |
/myapp/binance/apiKey |
Your Binance API key. |
/myapp/binance/apiSecret |
Your Binance API secret. |
The bot requires an input event configuration in JSON format. Below is an example configuration:
{
"targetAssetParameter": "BTC",
"amountParameter": "10",
"orderCurrencyParameter": "FDUSD",
"balanceThresholdParameter": "5000",
"notifications": [
{
"type": "bark",
"barkKeyParameter": "/myapp/bark/key",
"barkGroupParameter": "binance-dca"
}
],
"binanceApiKeyParameter": "/myapp/binance/apiKey",
"binanceApiSecretParameter": "/myapp/binance/apiSecret"
}To send through Telegram instead:
{
"notifications": [
{
"type": "telegram",
"telegramBotTokenParameter": "/myapp/telegram/token",
"telegramChatIDParameter": "123456789"
}
]
}To send through multiple channels, include multiple entries in notifications. If notifications is not configured, the legacy telegramBotTokenParameter and telegramChatIDParameter fields are still supported.
The bot sends notifications to the configured channels when:
- An order fails.
- Your balance falls below the configured threshold.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Commit your changes and push to your fork.
- Submit a pull request with a detailed description of your changes.