Skip to content
All library documents

Crypto Triangular Arbitrage from Small-Coin Order Book Spreads

Article Strategy library · Author: @cqz

Summary

This document describes a crypto arbitrage bot that compares a target market’s best bid and ask with synthetic prices formed through two other markets. It adjusts those synthetic prices for exchange-specific fees and available order-book depth, then uses the spread to decide when to place or cancel orders. The code gathers account and depth data asynchronously, tracks open orders and estimated profit and fees, and displays market and arbitrage prices in a chart.

The strategy exposes settings for data latency, price and amount precision, execution mode, order price offsets, and trade size limits. Its loop avoids acting on depth data that exceeds a configured latency threshold, and its exit and error handlers cancel outstanding orders. The document provides implementation details, not performance evidence. It does not establish profitability or fully account for real-world risks such as partial fills, changing fees, inventory constraints, or execution delays, so the calculated spread may not translate into realized profit.

Key ideas

  • The bot estimates triangular arbitrage prices from order-book levels across three exchange markets.
  • Exchange fee assumptions are incorporated into the synthetic buy and sell prices.
  • Depth requests are collected asynchronously, and stale responses can trigger a retry cycle.
  • Order offsets, precision, trade sizes, and execution mode are configurable.
  • The source describes implementation mechanics but gives no evidence of realized profitability.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.