Glossary

Algorithmic Trading

Algorithmic trading uses automated software to execute crypto trades based on predefined rules, market signals, or quantitative models.

Key Takeaways

  • Algorithmic trading uses software to execute buy and sell orders automatically based on predefined rules, removing human emotion and enabling speeds no manual trader can match. It accounts for 60 to 75% of all equity trading volume globally.
  • Common strategies include market making, arbitrage, trend following, and mean reversion. In crypto, on-chain bots also extract MEV from decentralized exchange transactions.
  • Risks are significant: flash crashes, API failures, overfitting to historical data, and cascading liquidations can amplify losses faster than any human could intervene.

What Is Algorithmic Trading?

Algorithmic trading (also called algo trading or automated trading) is the practice of using computer programs to execute trades according to a set of predefined instructions. These instructions can incorporate timing, price, volume, mathematical models, or any combination of market signals. The algorithm monitors market conditions continuously and places orders when its criteria are met, operating far faster than any human trader.

In traditional finance, algorithmic trading has dominated markets for over a decade, accounting for roughly 60 to 73% of U.S. equity volume. In cryptocurrency markets, adoption has grown rapidly due to the 24/7 nature of crypto trading, the availability of exchange APIs, and the fragmented liquidity across hundreds of venues. The global algorithmic trading market was valued at approximately $21 billion in 2025.

The core appeal is simple: algorithms eliminate emotional decision-making, execute at machine speed, and can monitor dozens of markets simultaneously. Whether it is a sophisticated hedge fund running statistical arbitrage across correlated pairs or a retail trader deploying a grid trading bot, the underlying principle is the same: let code make the trading decisions.

How It Works

At a high level, every trading algorithm follows a loop: observe market data, evaluate conditions against its ruleset, and execute orders when criteria are satisfied. The specifics vary enormously depending on the strategy, but the general architecture involves three components:

  1. Data ingestion: the algorithm receives real-time market data (prices, order books, trade history) from one or more exchanges via WebSocket connections or REST APIs
  2. Signal generation: the strategy logic processes incoming data and determines whether to buy, sell, or hold. This can range from simple moving average crossovers to complex machine learning models
  3. Order execution: when a signal triggers, the algorithm places orders through the exchange API, managing position sizing, order types, and risk limits automatically

Major Strategies

Several well-established strategies form the foundation of algorithmic trading in both traditional and crypto markets:

  • Market making: algorithms place simultaneous buy and sell limit orders around the current price, profiting from the bid-ask spread. Market makers provide liquidity to the venue and earn small profits on each round-trip trade. This strategy requires careful inventory management to avoid accumulating one-sided positions
  • Arbitrage: exploiting price differences for the same asset across different exchanges. Crypto markets are especially suited to arbitrage because liquidity is fragmented across hundreds of centralized and decentralized venues. Cross-exchange arbitrage, triangular arbitrage (between three trading pairs), and statistical arbitrage (between correlated assets) are all common
  • Trend following: algorithms identify and ride market momentum using technical indicators such as moving averages, breakout detection, or momentum oscillators. These strategies assume that prices tend to continue in their current direction
  • Mean reversion: the opposite of trend following. These algorithms bet that prices will revert to a historical average after a deviation. When an asset moves significantly above or below its mean, the algorithm takes a position expecting a correction

A Simple Strategy Example

A basic moving-average crossover strategy illustrates the core structure of an algorithmic trading system:

# Pseudocode: moving-average crossover
short_window = 20   # 20-period fast moving average
long_window = 50    # 50-period slow moving average

on_new_candle(candle):
    short_ma = average(close_prices[-short_window:])
    long_ma  = average(close_prices[-long_window:])

    if short_ma > long_ma and position == "flat":
        place_buy_order(size=calculate_position_size())
    elif short_ma < long_ma and position == "long":
        place_sell_order(size=current_position_size)

When the fast moving average crosses above the slow average, the algorithm enters a long position. When it crosses below, it exits. Real implementations add risk management, slippage tolerance, and fee calculations.

Crypto-Specific Considerations

While the core strategies translate from traditional finance, crypto markets introduce unique factors that algorithmic traders must account for.

Exchange Connectivity and API Limits

Crypto exchanges expose trading functionality through APIs with rate limits that vary by venue. Binance allows roughly 1,200 order-related requests per minute, while other exchanges enforce similar tiered limits. Algorithms must implement request throttling and efficient batching. During high-volatility periods, API latency can spike or connections may drop entirely, leaving open positions unmanaged.

On-Chain DeFi Bots vs. Centralized Exchange Algos

A major distinction in crypto algorithmic trading is between bots that operate on centralized exchanges and those that trade on-chain through decentralized exchanges.

Centralized exchange algorithms resemble traditional algo trading: they interact with private order books, enjoy relatively low latency, and compete on speed and signal quality. On-chain bots face a fundamentally different environment. Transactions are public in the mempool before execution, creating opportunities for maximal extractable value (MEV). MEV bots monitor pending transactions and insert their own trades to profit from others' activity.

In 2025, MEV extraction on Ethereum totaled approximately $562 million in transaction volume, with sandwich attacks accounting for over half. A single operator was responsible for roughly 70% of all Ethereum sandwich attacks that year. DeFi bots processed over $3.1 trillion in cumulative on-chain transaction volume during 2025, a 94% year-over-year increase.

MEV Awareness

Any algorithm trading on decentralized exchanges must account for MEV extraction. Common MEV strategies include:

  • Sandwich attacks: a bot detects a large pending swap in the mempool, places a buy order before it (front-running) and a sell order after it (back-running), profiting from the price impact of the victim's trade
  • Arbitrage: bots monitor AMM pools for price deviations after large trades and immediately rebalance across venues
  • Liquidation: bots monitor lending protocols for undercollateralized positions and execute liquidations to claim protocol rewards

Traders can protect against MEV using private transaction channels like dark pools, MEV-aware DEX aggregators, or protocols that use batch auctions to prevent front-running.

Tooling and Platforms

A range of tools exists for algorithmic crypto trading, from no-code platforms to fully custom solutions.

  • Hummingbot: an open-source market-making and arbitrage framework supporting over 140 exchanges (including DEXs). It has facilitated over $34 billion in reported trading volume and lets users configure strategies through a command-line interface or scripts
  • Freqtrade: an open-source Python bot with over 48,000 GitHub stars, focused on strategy development with backtesting, hyperparameter optimization, and machine learning integration through its FreqAI module
  • 3Commas: a no-code platform offering DCA bots, grid bots, and signal-based automation across 14+ exchanges. Suited for retail traders who want automation without writing code
  • Custom solutions: professional trading firms build proprietary systems using exchange APIs directly. Libraries like CCXT (a unified API wrapper supporting 100+ exchanges) reduce integration complexity for developers building custom bots
# Example: fetching order book data with CCXT (Python)
import ccxt

exchange = ccxt.binance({
    'apiKey': 'YOUR_KEY',
    'secret': 'YOUR_SECRET',
})

# Fetch BTC/USDT order book
order_book = exchange.fetch_order_book('BTC/USDT')
best_bid = order_book['bids'][0][0]
best_ask = order_book['asks'][0][0]
spread = best_ask - best_bid

Use Cases

Cross-Exchange Arbitrage

Crypto's fragmented liquidity across hundreds of exchanges creates persistent price differences. Arbitrage bots simultaneously buy on the cheaper venue and sell on the more expensive one, capturing the spread. This requires pre-funded accounts on multiple exchanges, fast execution, and careful accounting for withdrawal fees and transfer times. For deeper coverage, see the research on crypto on/off ramp market infrastructure.

Automated Market Making on DEXs

On-chain market making involves providing liquidity to AMM pools and actively managing positions. Algorithms adjust concentrated liquidity ranges in protocols like Uniswap v3, rebalancing as prices move to minimize impermanent loss and maximize fee income.

Portfolio Rebalancing

Algorithms can maintain target allocations across a portfolio by automatically trading when positions drift beyond a threshold. A portfolio targeting 60% Bitcoin and 40% stablecoins would trigger rebalancing trades whenever the allocation shifts beyond a defined band.

Dollar-Cost Averaging

Automated DCA bots execute regular purchases at fixed intervals, removing the temptation to time the market. While simple, DCA automation is one of the most widely used forms of algorithmic trading among retail investors.

Risks and Considerations

Flash Crashes

Algorithms can amplify market moves into cascading crashes. On May 6, 2010, the Dow Jones dropped approximately 1,000 points (9%) in minutes after a $4.1 billion automated sell order overwhelmed available liquidity. Crypto is especially vulnerable: in May 2021, Ethereum dropped from $3,200 to $700 on Kraken as algorithmic liquidation cascades compounded the decline. In March 2024, Bitcoin briefly fell from over $60,000 to $8,900 on BitMEX in two minutes before recovering within ten. During one such flash crash, an estimated 83% of the selling volume came from algorithms before human traders could even log in.

API and Infrastructure Failures

Algorithms depend entirely on exchange APIs. During extreme volatility (the exact moments when reliable execution matters most), APIs frequently become overloaded. Rate limiting, connection drops, and order rejection spikes can leave algorithms unable to manage open positions. Robust error handling, circuit breakers, and multi-exchange fallback routing are essential.

Overfitting

A strategy that performs brilliantly on historical data may fail in live trading. Overfitting occurs when an algorithm learns the noise in past data rather than genuine market patterns. A strategy showing a 57% win rate in backtesting can still lose money after accounting for transaction costs, slippage, and changing market conditions. Out-of-sample testing, walk-forward analysis, and conservative position sizing help mitigate this risk.

Latency Disadvantage

High-frequency trading firms like Jump Trading and Wintermute invest millions in co-location infrastructure and ultra-low-latency connectivity. Retail algorithms running on consumer hardware face a structural disadvantage in latency-sensitive strategies like arbitrage. Retail traders are better served by strategies that compete on signal quality rather than speed.

Regulatory Considerations

Algorithmic trading in crypto faces an evolving regulatory landscape. In March 2026, the SEC and CFTC jointly released guidance classifying crypto assets into five categories (including digital commodities and securities), which affects how algorithmic trading of different tokens is regulated. The EU's MiCA regulation, which took full effect in 2025, introduced compliance requirements for crypto service providers that extend to automated trading platforms. Traders and firms operating algorithmic systems should monitor their local regulatory environment and ensure compliance with applicable rules.

Why It Matters for Crypto

Algorithmic trading has become inseparable from crypto market structure. Market-making bots provide the liquidity that keeps spreads tight on exchanges. Arbitrage bots ensure price consistency across fragmented venues. MEV bots shape the transaction ordering layer of every EVM chain. Understanding how these systems work is essential for any participant in crypto markets, whether you are building a trading strategy, providing liquidity, or simply executing a swap on a DEX.

For Bitcoin-native infrastructure like Spark, algorithmic trading intersects with payment routing and liquidity management. Automated systems can optimize channel liquidity across payment networks, and stablecoin trading bots interact with assets like USDB across multiple venues.

This glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.