Bot Settings
5 мин. чтения
The “⚙️ BOT MAIN SETTINGS” section (main menu → settings) holds global DEXBOT options: timeouts, operating mode, notifications, logging, performance, and service tools. Changes made in Telegram are usually saved to the database and applied without rebuilding the binary.
Menu items (top to bottom):
- ⏱️ Timeout settings
- 🔧 Operating mode
- 🔔 Notifications
- 🧾 Logging settings (owner / full access)
- 🔁 Retry failed trades
- 🌐 Change language
- 👁️ Display settings
- 🚀 Performance (owner / full access)
- 🧅 TOR settings
- 🔑 API keys
- 🪪 License
- 📊 Monitoring dashboard
- 🆕 Update bot (owner only, when permitted)
- 🔙 Back — return to the bot main menu
⏱️ Timeout settings #
Controls timing for API calls, trading cycles, and individual operations. The menu is grouped into blocks (same as in the bot):
- 📡 API & network — API retry delay, max retries, pause between requests (rate-limit protection)
- ⏰ Intervals — pause between trading cycles, watchdog, per-chain cycle timeout
- ⚡ Processing delays — batch processing, indicator calculation, delay inside the trading loop
- ⏱️ Operation timeouts — buy, quote, price check, sell, single trade, market scan (all chains)
- 🔄 Reset timeouts — factory defaults
- ℹ️ Info — parameter help
Key parameters #
- Pause between trading cycles (
CHECK_INTERVAL_SECONDS) — seconds the bot waits after a full pass over all chains before the next cycle. Lower = more frequent checks, higher RPC/API load. - Market scan (all chains) (
TASK_EXECUTION_TIMEOUT) — max time for one full market scan across all enabled blockchains in a cycle. - Per-chain cycle timeout (
BLOCKCHAIN_CYCLE_TIMEOUT) — limit for processing one chain (pairs, indicators, trades). 0 = auto (depends on pair count and active trades). - Buy / sell timeout — upper time limit for a buy/sell operation (including on-chain confirmation).
- Quote timeout — time to fetch a price from the aggregator; the code enforces a sensible minimum to drop stuck quotes quickly.
- Single trade timeout — buy + wait + sell for one trading-bot position.
- Watchdog — after how many seconds without activity the system may treat the bot as hung and restart the process.
Factory values when you tap “🔄 Reset timeouts”:
- Pause between trading cycles: 600 s (10 min)
- Market scan (all chains): 1200 s (20 min)
- Single trade: 900 s (15 min)
- Buy / quote / price check / sell: 600 s each
- Per-chain cycle timeout: auto (0)
- API: retry 5 s, max 5 attempts, 1 s between requests
🔧 Operating mode #
Switch test vs live mode for the whole DEXBOT stack (trading bot, Grid, and AI when AI live mode is on).
- 🟧 Test mode — trades are not sent on-chain; logs and notifications still work; safe strategy testing.
- 🟢 Live mode — real transactions, gas spent, balances change.
- Changes apply immediately; before going live, unlock the wallet vault and review limits.
🔔 Notifications #
Hierarchical menu: master switch, antispam, level, chat IDs, then sections per bot.
General #
- Status — master on/off for all notifications
- Antispam interval — minimum gap between identical messages (0 = no time limit)
- Level — DEBUG / INFO / WARNING / ERROR / CRITICAL (importance filter)
- Admins (chat id) — delivery targets; IDs from
ADMIN_TELEGA_IDSin .env are also used - “Enable all” / “Disable all” buttons and ℹ️ help inside the menu
🤖 Trading bot #
- Token buy / sell (with TX button to block explorer)
- Low USDC / USDT balance, low gas, insufficient funds for a trade
- Trade errors, indicator signals (consensus)
- Profit/loss — PnL thresholds (batched message, ~2 h cooldown per trade)
🔷 Grid bot #
- Grid level buy and sell
- Alerts — balance, errors, price out of range, grid on/off
🧠 AI bot #
- Trades — buy/sell, dry-run, panic sell, daily limit
- API errors — 429, fallback model, key issues
⚙️ General (system) #
- API errors — Binance, RPC, Jupiter, etc.
- System health — start/stop, watchdog, license, vault, stuck transactions, test mode
🧾 Logging settings #
Console and file logging (main_config → LOGGING).
- Level — DEBUG, INFO, WARNING, ERROR
- Log to file — off by default (on servers, journalctl / systemd is often enough)
- Log file path — e.g.
logs/dexbot.log - Show timestamp in log lines — off by default
- Buffer size — in-memory entries before flush to disk (default 1000)
- Flush interval — seconds between buffer flushes (default 5)
- Export and clear logs — via menu buttons
The log buffer lives in LOGGING (not in PERFORMANCE).
🔁 Retry failed trades #
Automatic retries for sell operations on trading-bot trades marked FAILED (not buys).
- Enable / disable retries
- Delay between attempts (sec)
- Max attempts per trade
Stuck rows in the transactions table are also handled by a background cleaner (threshold ~30 min at startup).
🌐 Change language #
- Russian, English, and other
locales/files when available - Language is stored in the DB; the Telegram UI reloads immediately
👁️ Display settings #
Page sizes in Telegram menus (pagination):
- Blockchains per page
- Trading pairs per page
- Indicators per page
- Active trades per page
- Closed trades per page
Typical values: 5–20 items; 5–10 is comfortable on a phone.
🚀 Performance #
Hub with sections; after save, settings are applied immediately (cache, scan coordinator, dashboard metrics). Trade timeouts stay in the Timeouts menu.
💾 Cache & memory #
- DB cache (TTL) — lifetime of DB query cache (default 300 s)
- Max DB cache entries — entry count limit, not megabytes (default 1000)
- API price cache — TTL for external prices (default 10 s)
- Gas cache — TTL for fee data (default 60 s)
The Grid bot uses its own short price cache (~8 s) for levels — this is expected.
📡 Trading & scanning #
- Parallel chain scans (1–4) — how many blockchains can run heavy pair scans at once (trading, Grid, and AI share the limit). Default 2.
- Stagger per chain start (0–15 s) — spreads RPC peaks within one cycle. Default 3 s.
- Config reload from DB (30–600 s) — how often the trading loop fully reloads settings from the DB; saves in Telegram still apply at once. Default 120 s.
Scan priority: trading bot → Grid → AI; Grid/AI may defer work while a trading cycle is active.
🚀 Process startup #
- DEXBOT startup retries and delay (default 3 × 5 s)
- TELEGABOT retries and delay (default 5 × 10 s)
📊 Monitoring (dashboard) #
- Heavy metrics interval — GPU, sensors, network interfaces for the dashboard (60–86400 s, default 900 s). Little impact on trade speed.
Reset performance restores: cache_ttl 300, max_cache_size 1000, price 10, gas 60, scan 2 / stagger 3, reload 120, heavy metrics 900, startup values as above.
The “Trading cycle timeouts” button in the hub opens the Timeouts menu.
🧅 TOR settings #
- Modes: off / auto / on
- SOCKS host and port, auto port detection
- HTTP and Telegram via Tor — separate toggles
- Connection test (IP check)
🔑 API keys #
Store and enable keys for external services (aggregators, RPC, AI providers, etc.) through the bot’s secure menu.
🪪 License #
View license status, device binding, expiry, and activation limits.
📊 Monitoring dashboard #
In-bot Telegram panel: process state, resources, API stats, trading activity. Heavy metrics frequency is under Performance → Monitoring.
🆕 Update bot #
Available to the owner with remote-update permission. Runs the update script on the server: the bot restarts and active operations may be interrupted. Stop trading or wait for the current cycle to finish before updating.
📋 What happens when you change settings #
- Timeouts / mode / UI / FAILED retries — saved to the DB, picked up on the next cycle or immediately by handlers
- Performance — save +
apply_performance_runtime(cache, market scan, metrics) - Logging — buffer and level applied at runtime
- Notifications — no restart; filtered by flags and level
- Language — translations reloaded in memory
- Success confirmation in chat; validation errors as bot messages
⚙️ Navigation #
- 🔙 Back from settings root — to the main menu (/start)