Configuring a crypto trading bot like Freqtrade requires careful attention to exchange-specific nuances. While Freqtrade leverages the powerful CCXT library to interface with over 100 cryptocurrency exchanges, not all platforms behave the same way. Each exchange has unique API behaviors, rate limits, configuration requirements, and trading rules that can significantly impact bot performance—especially in live trading or backtesting scenarios.
This guide dives deep into exchange-specific configurations, highlighting critical settings, common pitfalls, and best practices for major platforms including Binance, Kraken, Kucoin, OKX, Bybit, and more. Whether you're setting up your first bot or fine-tuning an existing strategy, understanding these details is essential for reliability and compliance.
Understanding Exchange Configuration in Freqtrade
Freqtrade uses the CCXT library, a unified API wrapper supporting over 100 exchanges. However, only a subset of these have been thoroughly tested by the Freqtrade development team. Always verify compatibility before deploying your bot.
To configure an exchange, update the exchange section in your config file:
"exchange": {
"name": "binance",
"key": "your_api_key",
"secret": "your_api_secret",
"ccxt_config": {},
"ccxt_async_config": {}
}💡 Pro Tip: Use environment variables for sensitive data like API keys to enhance security.
Rate Limiting: Avoiding API Bans
Most exchanges enforce rate limits to prevent abuse. Freqtrade respects CCXT defaults, but you can customize them:
"exchange": {
"name": "kraken",
"ccxt_async_config": {
"enableRateLimit": true,
"rateLimit": 3100
}
}"rateLimit": 3100adds a 3.1-second delay between requests.- If you see
DDOS Exceptionerrors, increase therateLimitvalue. - Disabling rate limiting (
"enableRateLimit": false) risks IP bans.
👉 Discover how to optimize your trading bot’s API usage safely.
Binance: Key Configuration Tips
Binance is one of the most widely used exchanges with Freqtrade—but it comes with important restrictions.
Geo-Restrictions and Server Location
Binance blocks API access from certain countries, including:
- United States
- Canada
- Malaysia
- Netherlands
Always check Binance's Terms of Service for the latest eligibility rules.
Stop-Loss on Exchange Support
Binance supports stoploss_on_exchange, using stop-loss-limit orders for spot and both stop-market and stop-limit for futures. Enable this feature for faster execution and reduced slippage.
"order_types": {
"stoploss": "limit"
}Use "market" for immediate exit during volatility.
Recommended Blacklist: Avoid BNB Conflicts
Add "BNB/" to your pair blacklist unless:
- You maintain sufficient BNB for fee discounts.
- You’ve disabled BNB fee payments.
Trading BNB pairs may consume balance needed for fees, making future trades fail.
Binance Sites: Use Correct Exchange ID
Binance operates two domains:
binance.com→ Use exchange ID:binancebinance.us→ Use exchange ID:binanceus
Using the wrong ID results in unrecognized API keys.
RSA Keys Support
Freqtrade supports RSA-encrypted API secrets. Store them securely via environment variables:
export FREQTRADE__EXCHANGE__SECRET="$(cat ./rsa_binance.private)"Or inline in JSON (replace newlines with \n):
"secret": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBAD...\n-----END PRIVATE KEY-----"Binance Futures: Special Requirements
- Set Position Mode to One-way Mode.
- Set Asset Mode to Single-Asset Mode.
- Freqtrade checks these at startup and will error if misconfigured.
Use order book pricing due to lack of ticker data:
"entry_pricing": {
"use_order_book": true,
"order_book_top": 1
},
"exit_pricing": {
"use_order_book": true,
"order_book_top": 1
}Also, comply with Binance’s Futures Quantitative Rules to avoid trading restrictions.
Kraken: Data and Rate Limit Considerations
Kraken supports advanced order types and stop-loss on exchange using both stop-loss-market and stop-loss-limit orders.
Limited Historical Candle Data
The Kraken API returns only 720 historic candles, which is insufficient for robust backtesting. To overcome this:
- Use
--dl-tradeswhen downloading data. - Download official Kraken trade history ZIPs quarterly.
- Place CSV files in:
user_data/data/kraken/trades_csv.
Directory structure example:
trades_csv/
├── Kraken_full_history/
│ ├── BCHEUR.csv
│ └── XBTEUR.csv
├── Kraken_Trading_History_Q1_2023/
│ └── ...Convert to usable format:
freqtrade convert-trade-data --exchange kraken --format-from kraken_csv --format-to feather
freqtrade trades-to-ohlcv -p BTC/EUR BCH/EUR --exchange kraken -t 1m 5m 15m 1h⚠️ Note: Trade-to-candle conversion consumes significant RAM and time.
Rate Limit Tuning
Kraken’s rateLimit is in milliseconds between requests, not requests per second. Increase the value if you hit “Rate limit exceeded” errors.
Kucoin and OKX: Passphrase Requirements
Both Kucoin and OKX require a password (API passphrase) in addition to key and secret:
"exchange": {
"name": "kucoin",
"key": "your_key",
"secret": "your_secret",
"password": "your_passphrase"
}Kucoin Blacklist Recommendation
Add "KCS/" to your blacklist unless you actively manage KCS holdings for fee discounts.
OKX: Limited Candle History and Futures Modes
OKX returns only 100 candles per API call, limiting backtest depth. Additionally:
- Futures support both Buy/Sell (one-way) and Hedge (long/short) modes.
- Freqtrade supports both—but do not switch mid-trade.
- MARK price data is only available for ~3 months; older backtests may have inaccurate funding fee calculations.
👉 Learn how top traders navigate exchange limitations effectively.
Gate.io and Bybit: Permissions and Unified Accounts
Gate.io Fee Handling with POINT
Gate.io allows fee payment via POINT, a non-tradable token. Since automatic fee calculation fails, set:
"unknown_fee_rate": 0.001Adjust based on current POINT/stake currency value.
Required API permissions:
- Spot or Perpetual Futures (Read & Write)
- Wallet (Read)
- Account (Read)
Bybit Futures: Position Mode Management
Bybit uses isolated margin mode for USDT futures. On startup, Freqtrade sets position mode to One-way for the entire subaccount.
API key permissions required:
- Read-write
- Contract - Orders
- Contract - Positions
Use dedicated subaccounts per bot—especially with unified accounts—to avoid conflicts.
Hyperliquid: A Decentralized Exchange Approach
Hyperliquid is a DEX, so authentication uses wallet private keys instead of API keys:
"exchange": {
"name": "hyperliquid",
"walletAddress": "0x...",
"privateKey": "0x..."
}Best practices:
- Use an API wallet (not your main wallet).
- Never store your primary private key on the server.
- Deposit USDC via Arbitrum One chain.
- Only transfer trading capital—keep profits in cold storage.
Backtesting is limited to 5000 historic candles. Market orders are simulated as limit orders with 5% slippage.
Universal Best Practices Across All Exchanges
Fixing Nonce Errors
Persistent InvalidNonce errors indicate sync issues. The easiest fix? Regenerate your API keys.
Incomplete Candles and Repainting Risk
Most exchanges return an incomplete current candle. Freqtrade removes it by default to prevent repainting—false signals caused by changing candle values.
For latest price needs, use Freqtrade’s data_provider within strategies instead.
Advanced Configuration Override
Customize behavior using _ft_has_params:
"exchange": {
"name": "kraken",
"_ft_has_params": {
"order_time_in_force": ["GTC", "FOK"],
"ohlcv_candle_limit": 200
}
}Override defaults cautiously—test thoroughly first.
Frequently Asked Questions (FAQ)
Q: Why does my bot fail on Binance despite correct API keys?
A: You may be in a geo-restricted country or using binance.com instead of binance.us. Verify location and exchange ID.
Q: How can I improve backtesting data for Kraken?
A: Download official trade history ZIPs and convert them using freqtrade convert-trade-data.
Q: What causes 'InvalidNonce' errors?
A: Clock drift or reused API calls. Regenerate API keys to resolve.
Q: Can I use multiple bots on one exchange account?
A: Not recommended—especially on Bybit or unified accounts. Use separate subaccounts.
Q: Does Freqtrade support market orders on Hyperliquid?
A: No—market orders are simulated as limit orders with up to 5% slippage.
Q: How do I handle fee tokens like BNB or KCS?
A: Either blacklist the token pairs or manually maintain sufficient balance for fees.
👉 Maximize your bot’s potential with secure, high-performance exchange integration.
Core Keywords: Freqtrade, crypto trading bot, exchange configuration, stoploss on exchange, API rate limits, backtesting data, CCXT, trading automation