Bot Settings
8 мин. чтения
Chapter “SETTING UP A BOT” It contains all the global system settings. Here you can configure timeouts, operating modes, notifications, and other system settings.
⏱️ Timeout settings #
Managing time parameters of operations and system performance:
- 📡 API and network — delay settings for API requests and network interaction
- ⏰ Intervals — settings for verification, watchdog, and monitoring cycles
- ⚡ Processing Delay — settings for batch processing, indicator calculations, and trading operations
- ⏱️ Operation Timeouts — time to buy, sell, scan the market and get quotes
- 🔄 Reset Timeouts — return to standard optimal values
Detailed settings and their impact:
- API Replay Delay — time between repeated requests in case of network errors. Lower value = faster retries, higher = less load on API
- Maximum number of API repeats — number of attempts in case of errors. Higher value = higher reliability, but longer waiting time
- API Request Delay — pause between requests to avoid the rate limit. Optimal: 1-5 seconds
- Verification interval — time between market scanning cycles. Lower = faster response, higher = less load
- Purchase Timeout — the maximum time to purchase a token. Recommended: 300-600 seconds
- Sale Timeout — the maximum time for the token sale. Recommended: 300-600 seconds
- Scan Timeout— time to check all blockchains and pairs. Recommended: 480-900 seconds
- Quote receipt timeout — time to receive the token price. Recommended: 300-600 seconds
- Timeout of one transaction — total time to buy + wait + sell. Recommended: 600-1200 seconds
Standard values (when reset):
- Market scanning: 1200 sec (20 minutes)
- Pause between cycles: 300 sec (5 minutes)
- One deal: 900 sec (15 minutes)
- Verification interval: 600 sec (10 minutes)
- Purchase/Sale: 600 sec (10 minutes)
🔧 Operating mode #
Switch between test and operational mode for safe testing and real trading:
- 🟧 Test mode — secure testing without real transactions. All operations are simulated, no money is spent.
- 🟢 Operating mode — full-fledged trading with real money. All transactions are executed on real blockchains
- Instant switching — changes are applied immediately without restarting the bot
- Safety — protection against accidental transactions in test mode, complete isolation from real funds
- Validation — checking the correct switching and system status
Features of the modes:
- Test mode:
- — All transactions are simulated without real transactions
- — Balances are shown as they are, but not changed
- — Indicators work with real data
- — Notifications are sent as usual
- — Logging takes place in full
- Operating mode:
- — All transactions are executed in reality on blockchains
- — Balances change during purchases and sales
- — Commissions are deducted for each transaction
- — Profits and losses are real
🔔 Notifications #
Setting up a notification and alert system to monitor the work of the bot:
- Notification status — enable/disable the entire notification system
- Antispam Interval — minimum time between notifications (0 = disable)
- Notification level — details of messages (short/detailed)
- Admins — a list of chats for receiving notifications (ID separated by a space)
Types of notifications and their purpose:
- Purchase of a token — notifications of new purchases with details: token, amount, price, blockchain
- Token Sale — notifications of sales with the result: profit/loss, percentage, time in the transaction
- There is no USDC balance — warnings about the lack of USDC for purchases
- No USDT balance — warnings about the lack of USDT for purchases
- Not enough gas — notifications of gas shortage for transactions
- Not enough for a deal — warnings about a small balance for a minimal transaction
- Transaction errors — notifications about problems with operations: slippage, API errors, failures
- Indicator signals — notifications of technical signals: RSI, MACD, Bollinger Bands
- Profit/Loss — reports on financial results: daily/weekly statistics
- API Errors — notifications about API issues: rate limit, unavailability, network errors
- System health — monitoring the status of the bot: memory, CPU, disk, network
Antispam Settings:
- Interval 0 — notifications are sent without restrictions
- Interval 30-60 seconds — moderate spam protection
- The interval is 300+ seconds — Strong protection, only important notifications
- Duplicate notifications — automatically skipped if less than an interval has passed
🧾 Logging Settings #
Event logging and recording system management for debugging and monitoring:
- Logging level — record details (DEBUG, INFO, WARNING, ERROR). Affects the number of records
- Writing to a file — enabling/disabling logging to a file. Disabled by default (systemd shows)
- The path to the logs file — setting the file location (logs/dexbot.log)
- Showing the time — enable/disable timestamps. Disabled by default
- Buffer size — the number of memory entries before writing to disk (1000 by default)
- Recording interval — the frequency of recording logs to disk in seconds (5 by default)
- Exporting logs — downloading a log file for analysis
- Clearing logs — delete old records to save space
Logging levels:
- DEBUG — maximum detail, all events, including technical ones
- INFO — basic information: сделки, уведомления, важные события
- WARNING — Warnings: проблемы с API, недостаток баланса
- ERROR — only mistakes: сбои, неудачные сделки, критические проблемы
File Logging Settings:
- Automatic directory creation — the logs folder is created automatically
- UTF-8 encoding — Russian language support in logs
- Time format — YYYY-MM-DD HH:MM:SS for easy reading
- Log rotation — automatic file size management
🔁 Repeat transactions with an error #
Setting up retries for failed transactions with the FAILED status:
- Repeat status — enable/disable automatic replays of failed sales
- Repeat delay — waiting time between attempts in seconds
- Maximum attempts — limit the number of repetitions per trade
- Types of errors — which errors are repeatable (slippage, API errors, network issues)
- Logging of repetitions — record all attempts in the log for analysis
- Replay Notifications — notifications about repeated sales attempts
The mechanism of operation:
- Automatic detection — the system finds transactions with the FAILED status
- Waiting for a delay — pause before trying again
- Repeat sale — attempt to sell the token again
- Increasing slippage — during repeated attempts, the slippage may increase
- Attempt limit — after reaching the maximum, the transaction remains unsuccessful
Recommended settings:
- Delay: 300-600 sec — time to stabilize the market
- Maximum attempts: 3-5 — balance between success and resources
- Sales only — Repeats apply only to unsuccessful sales
- Logging is required — to analyze the causes of failures
🌐 Change Language #
Customize the interface language to personalize the user experience:
- Russian — the main interface language, full localization of all elements
- English — English language, alternative interface
- Instant application — changes are applied immediately without restarting
- Saving to the database — the settings are saved in the database for all sessions
- Reloading the interface — updating all menu items and messages
Localization features:
- Full support — all buttons, messages, descriptions have been translated
- Saving settings — the language is remembered between restarts
- Dynamic switching — you can change the language at any time
- Formatting — dates, numbers, currencies are adapted to the language
- Technical terms — the special terminology has been translated correctly
👁️ Display Settings #
Personalization of the interface and data display for ease of use:
- Page Size — the number of elements on the page: 5/10/20/50 elements
Pagination Settings:
- 5 elements — for mobile devices and quick browsing
- 10 elements — standard size for most occasions
- 20 elements — for analyzing a large amount of data
- 50 elements — for a complete overview of all data
🚀 Performance Settings #
Optimization of system operation, caching and resource management:
- 💾 TTL Cache — lifetime of cached data in seconds
- 💾 Maximum cache size — memory limit for the cache in MB
- 💲 TTL Price Cache — lifetime of the token price cache
- ⛽ TTL Gas Cache — lifetime of the blockchain gas cache
- 🔄 Launch Repeats — the number of startup attempts in case of failures
- 🔄 Startup delay — time between startup attempts
- 🔄 Telegram Delay — pause between Telegram API requests
- 🔄 Maximum Telegram repeats — the replay limit for Telegram
- 🔄 Performance Reset — return to standard optimal values
Detailed caching settings:
- TTL cache (30-300 sec) — total data storage time in memory
- Maximum size (100-1000 MB) — RAM usage limit
- Price cache (60-600 seconds) — the time of the relevance of token prices
- Gas cache (300-1800 seconds) — the time of relevance of blockchain gas
Startup and Stability settings:
- Launch repeats (3-10) — the number of attempts in case of system failures
- Start delay (5-30 seconds) — pause between attempts
- Telegram delay (1-5 seconds) — avoiding the Telegram API rate limit
- Maximum Telegram repeats (3-5) — the replay limit for Telegram
Performance optimization:
- TTL reduction — more recent data, but more requests
- TTL Increase — fewer requests, but the data may be outdated
- Increasing the cache size — more data in memory, but more RAM
- Reducing cache size — save RAM, but less cached data
📊 Dashboard monitoring #
A monitoring and analytics system for monitoring the work of the bot in real time:
- System status — general condition of the bot: running/stopped/error
- Efficiency — work speed metrics: response time, throughput
- Resource usage — CPU, memory, disk, real-time network
- API Statistics — number of requests, errors, and successful operations
- Trading activity — number of transactions, their status, profit/loss
- Charts — data visualization: trends, patterns, anomalies
- Alerts — problem notifications: critical errors, exceeding limits
Monitoring metrics:
- System metrics — CPU, RAM, disk, network, temperature
- Business metrics — number of transactions, profit, success rate
- Technical metrics — API response time, errors, timeouts
- Custom Metrics — activity, use of functions
Dashboard Functions:
- Real time — data updates every few seconds
- Historical data — view trends for different periods
- Exporting data — uploading reports in various formats
- Setting up alerts — configuration of problem notifications
- Comparison of periods — performance analysis
Advantages of monitoring:
- Proactive identification of problems — detecting problems before they become critical
- Performance optimization — identification of system bottlenecks
- Performance analysis — evaluation of trading strategies
- Resource planning — forecasting of resource requirements
🔧 System Functions #
- Automatic saving — all changes are saved to the database
- Data validation — checking the correctness of the entered values
- Reloading configurations — updating settings from the database
- Error handling — correct exception handling
- Logging — record all actions in the log
- Secure Handlers — protection against interface failures
- Caching — quick access to settings
- Synchronization — updating settings between components
📋 What happens when settings are changed #
- Instant application — new settings are applied immediately
- Saving to the database — changes are recorded in the database
- Updating the cache — the settings cache is updated
- Reloading configs — the bot is reloading the configuration
- Validation — checking the correctness of new values
- Notifications — confirmation of successful saving
- Logging — record changes in the log
- Synchronization — updating settings in all modules
⚙️ Menu navigation #
- 🔙 BACK — return to the main menu
- 🌐 BLOCKCHAINS — transition to the settings of blockchains