How Does a Crypto Trading Bot Work?
A crypto trading bot is software that trades on an exchange for you, following a defined set of rules. It watches the market, decides when the rules say to act, and places orders through the exchange's interface for programs — around the clock, without a person at the screen.
Understanding a bot is easiest when you separate its three layers.
Layer 1 — The strategy (the rules)
Every bot executes a strategy: a precise definition of when to buy, when to sell, and how much. Strategies range from simple to sophisticated:
- Rule-based: "If price crosses above the 20-day average, open a long; exit when it crosses back." Trend-following and mean-reversion systems live here.
- Indicator-driven: combinations of technical signals (momentum, volatility bands, parabolic SAR and similar) with defined thresholds.
- Model-driven (AI): systems whose parameters or signals come from statistical models trained on historical data, sometimes adapting to changing market conditions — for example, classifying the current market regime and adjusting behavior accordingly.
Common strategy families include trend following, mean reversion, and breakout systems — each suited to different market conditions.
The strategy is the part that determines results. The rest of the bot is plumbing — necessary, but not where performance comes from. A well-built bot running a poor strategy loses money precisely and tirelessly.
Layer 2 — Execution (turning signals into orders)
When the strategy signals, the execution layer converts the decision into exchange orders: choosing order type, size, and handling what happens if an order only partially fills. Good execution also enforces safety rules — position limits, stop conditions, and emergency shutoffs (a "kill switch") that flatten positions if something behaves unexpectedly.
Execution quality shows up in the gap between a strategy's theoretical results and its live results: fees, slippage, and timing all live here. This is one reason live-verified performance is more informative than backtests alone.
Layer 3 — The connection: exchange API keys
Bots don't log into your account with a password. Exchanges provide API keys — credentials created by the account owner that grant specific, limited permissions:
- Read — view balances and positions
- Trade — place and cancel orders
- Withdraw — move funds out (a separate permission)
The key detail: these permissions are independent. A bot needs read and trade — it never needs withdrawal permission. A key created with withdrawal disabled means the software can trade but cannot move funds off the exchange, no matter what happens. Security-conscious platforms enforce this by rejecting keys that have withdrawal enabled. (More on this in Why a Trading Bot Should Never Have Withdrawal Permission.)
Where does the bot actually run?
Two models exist:
- Self-hosted: you run bot software on your own computer or server. You control everything and maintain everything — uptime, updates, and strategy quality are your job.
- Platform-hosted: the bot runs on a platform's infrastructure and trades your exchange account through your API key. Your funds stay on your own exchange; the platform supplies the strategy and the 24/7 operation. Selecting a strategy to follow — copy trading — is the usual entry point here (see What Is Copy Trading in Crypto?).
In both models, a structural best practice is to give each strategy its own sub-account, so strategies never interfere with each other and each one's results are cleanly measurable.
What a bot does not do
A bot removes emotion, hesitation, and the need for sleep. It does not remove market risk: leverage, drawdowns, and liquidation exist for automated traders exactly as they do for manual ones. The honest framing is that a bot executes a strategy consistently — and consistency is only valuable when the strategy itself has merit, which is why inspecting a strategy's live statistics comes before automating anything.
ONYX is one implementation of the platform-hosted model: algorithmic strategies run 24/7 through withdrawal-disabled API keys, each in an isolated sub-account on the user's own exchange (Toobit or BingX), with live-verified statistics shown per strategy. The full picture is on the ONYX home page.
This article is for general information only and is not financial advice. Futures trading carries risk of principal loss and liquidation. Past results do not guarantee future performance.