Atlas LP
  1. Home
  2. Blog
  3. Atlas LP Bot Lifecycle: From Initialization to Safe Shutdown

Atlas LP

Atlas LP Bot Lifecycle: From Initialization to Safe Shutdown

Explore the full lifecycle of an Atlas LP spot market making bot, from secure initialization and order placement to error handling and safe shutdown.

Published

Introduction

Operating a spot market making bot in crypto markets requires careful attention to security, reliability, and transparency. Atlas LP is built to support these needs with a lifecycle that covers every stage—from secure initialization through live trading, error handling, and safe shutdown. This post walks through the lifecycle of an Atlas LP bot, highlighting the engineering considerations and operational safeguards at each step.

1. Initialization: Secure Setup and Validation

Before an Atlas LP bot can start trading, it must be properly initialized. This stage is critical for ensuring both security and operational correctness.

Key steps in initialization:

  • API Key Registration: Users register their exchange API keys in Atlas LP. Only spot trading and read permissions are required—withdrawal permission is never requested. API keys and secrets are encrypted using AES-256-GCM before storage, and decrypted only by the worker that connects to the exchange.
  • Exchange and Symbol Selection: Users can register multiple exchange accounts (supported exchanges include Binance, DigiFinex, LBank, BingX, XT.com, Biconomy, Toobit, CoinW, P2B, Azbit, Dex-Trade, Ourbit) and create a bot per symbol.
  • Settings Configuration: The user configures the bot's strategy parameters, such as base price, min/max spread in basis points (minimum width 40 bps), nested day and hour bands, number of bid/ask levels, level spacing (from 0.1 bps), order size range (must meet exchange minimums), and tick interval (from 0.5 seconds, default 3 seconds).
  • Settings Validation: Atlas LP validates all settings before a bot can start. This includes checking symbol rules, minimum order quantities and notional values, and ensuring the spread band and order ladder are logically consistent.
  • API Verification: Atlas LP performs a detailed verification of the API connection, checking ticker data, order book, symbol rules, balances, open orders, and trades. Optionally, it can place a limit order far from the market and cancel it immediately to confirm trading permissions.

If any credentials are invalid or settings fail validation, the bot will not start, and the user is notified of the issue.

2. Active Trading: Real-Time Market Making

Once initialized, the bot enters its active trading phase. Here, Atlas LP operates as a genuine market maker by placing resting limit orders that any market participant can trade against. Wash trading, self-trading, and volume manipulation are strictly prohibited.

How the active trading phase works:

  • Tick Cycle: At each tick (interval as configured), the bot reads the latest ticker and order book data using WebSocket streams or REST API. If data is stale or the order book is crossed, the tick is skipped to avoid erroneous actions.
  • Order Ladder Calculation: The bot computes the desired ladder of limit orders based on the configured spread, level count, spacing, and order size range. Order sizes are randomized within the allowed range, always meeting exchange minimums.
  • Order Placement and Cancellation:
    • The bot places any missing limit orders on both bid and ask sides.
    • Only excess or mispriced orders are cancelled, minimizing unnecessary churn.
    • If the market has no quotes, the bot seeds one buy and one sell order around the base price to establish presence.
  • Real-Time Monitoring:
    • Open orders, recent fills (with fees), balances, and bot events are continuously synced and displayed in the Atlas LP console.
    • A daily snapshot records the account's asset value for historical monitoring.
  • User Controls:
    • Users can cancel individual or all open orders for a symbol directly from the bot page.
    • Stopping the bot halts new order placements and can trigger order cancellations as needed.
  • Telegram Alerts:
    • Users can configure Telegram alerts to notify them if a running bot has had no fills for a specified number of minutes, helping to monitor liquidity activity.

3. Error Handling and Resilience

Robust error handling is essential for reliable market making. Atlas LP incorporates several mechanisms to detect and respond to issues:

  • API Credential Errors: If the exchange rejects the API credentials (due to permission changes, key expiry, or other issues), the bot stops automatically and sets an error status. The user is notified to review and update their credentials.
  • Data Quality Checks: The bot skips ticks if market data is stale or the order book is crossed, preventing actions based on unreliable information.
  • Order Placement Failures: If an order placement or cancellation fails (due to exchange errors or network issues), the bot logs the event and retries as appropriate.
  • Settings Validation on Restart: If the bot is restarted, all settings and API connections are re-validated before resuming trading.

These safeguards help maintain operational integrity and minimize the risk of unintended trading actions.

4. Safe Shutdown: Stopping the Bot and Managing Orders

A safe and controlled shutdown is as important as secure initialization. Atlas LP provides clear procedures for stopping bots and managing open orders:

  • User-Initiated Stop: Users can stop a bot at any time from the console. This immediately halts new order placements.
  • Order Cancellation: Users can choose to cancel all open orders for the symbol, either manually or as part of the shutdown process. Individual open orders can also be cancelled as needed.
  • Event Logging: All shutdown actions, order cancellations, and related events are logged in the console for transparency and auditability.
  • No Orphaned Orders: By design, Atlas LP ensures that stopping a bot does not leave orphaned or unmanaged orders on the exchange account.

5. Monitoring and Audit Trail

Throughout its lifecycle, Atlas LP provides users with real-time visibility and historical records:

  • Console Monitoring: Users see open orders, recent fills, balances, and bot events in real time.
  • Daily Asset Snapshots: Each day, the bot records the account asset value for later review.
  • Event Logs: All key actions—initialization, order placements, cancellations, errors, and shutdowns—are logged for auditability.

Summary Table: Atlas LP Bot Lifecycle

StageKey ActionsUser Controls
InitializationAPI setup, settings validation, API verificationRegister keys, configure bot
Active TradingTick cycle, order placement/cancellation, monitoringCancel orders, stop bot
Error HandlingData quality checks, API error detectionUpdate credentials
Safe ShutdownStop bot, cancel orders, log eventsManual/auto order cancellation
MonitoringReal-time console, daily snapshots, event logsView stats, review history

Conclusion

The Atlas LP bot lifecycle is designed for security, transparency, and operational resilience at every stage. From secure initialization and real-time market making to robust error handling and safe shutdown, Atlas LP empowers users to provide genuine spot liquidity while maintaining full control over their exchange accounts.

To learn more about Atlas LP's features and supported exchanges, visit /liquidity-bot or /supported-exchanges.

Atlas LP does not guarantee returns, prices, volume, or listings.

Crypto trading involves risk. Atlas LP is software for placing and managing limit orders; it does not guarantee returns, prices, volume or listings. Follow the rules of each exchange and applicable law.

← Back to blog

Frequently asked questions

How does Atlas LP ensure API key security during bot initialization?

Atlas LP encrypts all API keys and secrets using AES-256-GCM before storage. Keys are only decrypted by the worker process that connects to the exchange, and withdrawal permission is never requested.

What happens if my exchange API credentials become invalid while the bot is running?

If the exchange rejects the credentials, Atlas LP automatically stops the bot and sets an error status. You will need to update your credentials before restarting the bot.

Can I cancel all open orders when stopping a bot?

Yes, Atlas LP allows you to cancel all open orders for a symbol directly from the bot page. You can also cancel individual orders as needed.

Does Atlas LP support market orders or only limit orders?

Atlas LP only places limit orders. It never uses market orders, ensuring that all orders rest on the order book and can be traded against by any participant.

How does Atlas LP handle errors during trading?

Atlas LP monitors for stale or crossed order books, API errors, and order placement failures. It logs all events and retries actions when appropriate, stopping the bot if critical errors occur.

Related articles

Run your spot liquidity bot with clear controls

Connect an exchange API key, set your spread band and order levels, and monitor orders, fills and balances from one console.

Create an account