Strategies

Automating Triangular Arbitrage With Bots

Published 2026-10-10 · 8 min read

Automating Triangular Arbitrage With Bots

Triangular arbitrage is one of the few strategies where human hands cannot keep up. A profitable loop between three currency pairs may exist for five to ten seconds before other traders close it, so automating triangular arbitrage with a bot is the standard approach, not an optional upgrade. But a bot is not a magic money machine. This guide explains what a bot does, the components it needs, latency realities, and the honest caveats beginners should hear first. For the underlying strategy, see our triangular arbitrage guide.

Why Speed Is the Entire Game

Triangular arbitrage profit comes from momentary mispricing between three pairs, corrected almost immediately by other participants. Spot a loop manually and by the time you type three orders into an interface, the prices have moved and the edge is gone. A bot polls order books continuously, detects loops the instant they appear, and fires all three legs within milliseconds. Without that speed, you are racing software with a keyboard — a race you lose every time.

Speed matters for surviving the edge, not just capturing it. Triangular arbitrage only works if all three legs execute near the computed prices. A one-second delay between the first and third leg can turn a small profit into a loss, because the market moves while you are mid-loop. That is why bots fire legs as close together as possible and professionals colocate servers near exchanges. Slow execution kills the strategy no matter how good your detection logic is.

What a Triangular Arbitrage Bot Actually Does

At its core, a triangular arbitrage bot runs a loop: poll candidate order books, compute the implied rate around each three-pair loop, and compare it against the direct rate plus fees. It checks whether converting A to B to C back to A leaves more A than you started with, after taker fees on all three legs. Only when the net edge exceeds a configured threshold does it act. Everything else is filtering noise and avoiding trades that lose money after costs.

When it fires, the bot submits all three legs as quickly as possible with immediately-executing orders. It verifies each leg filled at an acceptable price, handles partial fills, and logs the result. A good bot also refuses to trade in dangerous conditions — wide spreads, thin books, latency spikes — which signal an unreliable edge. Discipline in skipping trades matters as much as speed in taking them.

The Four Key Components

  • Price feed: a fast, reliable stream of order book data (usually WebSocket) covering every pair in your candidate loops. Stale or incomplete data produces phantom edges.
  • Loop detection: the math engine that enumerates triplets, computes implied rates from live books, subtracts fees, and flags loops above your minimum edge threshold.
  • Execution engine: the module that places, tracks, and cancels orders across all three legs, with logic for partial fills, slippage limits, and emergency exits.
  • Fee and risk accounting: accurate fee modeling per leg (maker vs taker, tier discounts), position sizing, daily loss limits, and a ledger of every loop's outcome for review.

Latency Realities Most Beginners Miss

Latency is the gap between seeing a price and acting on it, with several layers: code reaction time, network trip, matching engine, and API rate limits. Retail traders face tens to hundreds of milliseconds round-trip; professional firms operate in single digits from colocated servers. That gap decides who captures the best loops. You can still compete on lower-liquidity triplets the giants ignore, but be realistic about which loops are winnable at your speed.

API rate limits are a hard constraint beginners underestimate. Exchanges cap requests per second, and aggressive polling of dozens of books can get your key throttled. Efficient bots use WebSocket streams, request only needed data, and queue orders carefully. Hitting a limit mid-loop is a classic failure: the first leg fills, the second order is rejected, and you hold an unintended position. Design around limits from day one.

Honest Caveats: Bots Are Not Magic

Risk Disclosure

A triangular arbitrage bot does not guarantee profit. You need real capital, a favorable fee tier, reliable infrastructure, and code that handles failure modes like partial fills and exchange outages. Most beginners lose money to fees and bugs before they ever see a consistent edge. Treat any bot project as experimental software with real financial risk.

First, you need enough capital for small edges to matter: 0.2 percent on 500 dollars earns one dollar before costs; on 50,000 dollars it earns one hundred. Second, your fee tier matters enormously — retail taker fees can erase the whole edge, so profitable operators usually hold volume discounts. Third, infrastructure costs real money: a nearby VPS, data feeds, and monitoring add up. Finally, bugs are expensive: a leg-sizing error can drain an account fast, so paper-trade and simulate extensively before going live.

Beginner Guidance Without Product Picks

Start with education, not code: read the triangular arbitrage guide, learn order books and fee schedules, and practice the profit math by hand. Then build a detector that only logs opportunities, and study how often real edges appear and how long they last. That reveals whether the strategy suits your capital and fee tier before you risk anything. Only then add execution, starting tiny with strict loss limits. Or compare approaches in our scanner comparison if you prefer monitoring to building.

Do I need a bot for triangular arbitrage, or can I trade manually?

In practice, you need automation. Profitable loops typically last seconds, far shorter than manual order entry allows. Manual trading can work for learning the math on paper, but capturing real edges requires software that detects loops and fires all three legs in milliseconds.

How much capital does a triangular arbitrage bot need?

It depends on your edge size and fee tier, but small accounts struggle because tiny percentage edges produce tiny dollar returns. Many beginners find that fees and infrastructure costs exceed profits until they trade meaningful size at a discounted fee tier. Start small to learn, but expect realistic returns to scale with capital.

What programming skills are needed to build one?

You need a language with good HTTP and WebSocket support, comfort with REST APIs, and solid handling of concurrency and error cases. More important than the language is understanding order books, fee math, and failure modes like partial fills. The strategy logic is simple; the reliability engineering is the hard part.

Can a bot run profitably on a home computer?

Possibly for learning, but a home connection adds latency and downtime risk. Most serious operators use a VPS located near the exchange's servers for lower round-trip times and 24/7 uptime. For experimentation, a home setup is fine as long as you trade tiny sizes and accept the speed disadvantage.

What is the biggest beginner mistake with arbitrage bots?

Underestimating fees and overestimating edge frequency. Beginners often compute gross edges, forget taker fees on all three legs, and discover their 'profitable' loops lose money. The second mistake is going live without handling partial fills, API errors, and exchange downtime in the code.

See arbitrage opportunities live

Crypto Arbitrage Scanner monitors 16 exchanges in real time — try it free for 3 days.

Start Free Trial