Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Configuration Reference

Complete reference for all fields in config.toml.

[bot]

General bot settings.

FieldTypeDefaultDescription
dry_runboolfalseSimulate orders without exchange calls
db_pathstring"trading-bot.db"SQLite database file path
max_retriesu323Max retry attempts per API call
circuit_breaker_thresholdu325Consecutive failures before circuit break
circuit_breaker_cooldown_secsu6460Seconds to pause after circuit break
shutdown_wait_secsu6410Seconds to wait for in-flight orders at shutdown

[bybit]

Exchange API credentials and connection settings.

FieldTypeDefaultDescription
api_keystringrequiredBybit API key (empty string OK in dry-run)
api_secretstringrequiredBybit API secret
testnetbooltrueUse testnet endpoints
recv_window_msu645000Request receive window (milliseconds)
account_typestring"UNIFIED"Account type for wallet balance lookups

[grid]

Grid trading strategy parameters. Ignored when autopilot.enabled = true.

FieldTypeDefaultDescription
symbolstringrequiredTrading pair (e.g., "BTCUSDT")
lower_pricef64requiredGrid lower price bound
upper_pricef64requiredGrid upper price bound (must be > lower)
levelsu32requiredNumber of grid lines (must be >= 2)
qty_per_level_basef64requiredBase asset quantity per grid order
poll_secsu643Seconds between fill-detection polls
cancel_existing_on_startbooltrueCancel all existing orders on symbol at startup
auto_rebalanceboolfalseShift grid when price exits the range
trailing_profit_thresholdf640.0Take-profit threshold in quote currency (0 = disabled)

[risk]

Risk management limits. All fraction values are relative to starting_equity_quote.

FieldTypeDefaultDescription
starting_equity_quotef64requiredStarting balance in quote currency (USDT)
max_total_exposuref640.80Max total portfolio exposure (80%)
max_per_marketf640.40Max exposure per market type
max_per_symbolf640.20Max exposure per trading pair
max_per_strategyf640.15Max exposure per strategy
daily_loss_limitf640.05Daily loss limit (5%)
weekly_loss_limitf640.10Weekly loss limit (10%)
max_drawdownf640.15Max drawdown from equity peak (15%)

[alerts]

Webhook notification settings. Omit the entire section to disable alerts.

FieldTypeDefaultDescription
webhook_urlstring?nullWebhook URL (Slack, Discord, or HTTP POST)
on_fillboolfalseSend alert on every order fill
on_risk_breachbooltrueAlert when risk limits are hit
on_lifecyclebooltrueAlert on bot startup/shutdown
on_errorbooltrueAlert on API errors and circuit breaker
pnl_summary_interval_secsu640Periodic P&L summary interval (0 = disabled)

[autopilot]

Autonomous trading mode. When enabled, [grid] symbol/range are ignored.

FieldTypeDefaultDescription
enabledboolfalseEnable auto-pilot mode
scan_interval_secsu641800Re-scan market every N seconds (30 min)
switch_thresholdf6415.0Score improvement needed to switch symbols
max_gridsusize1Max simultaneous grids (symbols)

[autopilot.scanner]

Scanner tuning for auto-pilot market analysis.

FieldTypeDefaultDescription
min_turnoverf641000000.0Minimum 24h turnover in quote currency
max_spread_pctf640.2Maximum bid-ask spread percentage
quote_currenciesstring[]["USDT"]Quote currencies to scan
max_resultsusize10Top N candidates to analyze in depth
kline_intervalstring"60"Kline interval in minutes
kline_countusize200Number of candles to fetch per symbol

Validation Rules

  • grid.levels must be >= 2 (unless autopilot is enabled)
  • grid.lower_price must be > 0 and < grid.upper_price
  • grid.qty_per_level_base must be > 0
  • bybit.api_key and api_secret must be non-empty unless bot.dry_run = true
  • risk.starting_equity_quote must be > 0