Arbitrage Trading Bot for Binance.US

DESCRIPTION

Analyzed real-time financial market data from Binance.US, identifying arbitrage opportunities and automatically executing trades via Binance’s REST API.

TOOLS

PythonPandasNumPyBinance API

TIMELINE

March 2025

The idea behind triangular arbitrage is pretty simple: if the price relationships between three assets are temporarily out of sync, you can cycle through them and end up with more than you started with.

The bot watched 6 trading pairs simultaneously: SOLETH, ETHBTC, SOLBTC, and their respective USDC pairs. It calculated 6 arbitrage ratios in real time, and when any ratio clears 1.01 after accounting for fees, it fires off a sequence of 3 limit orders to capture the spread.

Each run pulls the current order book depth, computes the ratios, checks all 6 conditions, and logs information to a CSV: timestamps, ratios, order IDs, quantities, prices, and whether a trade even fired.

While the bot worked mechanically, the arbitrage opportunities in crypto are razor thin and Binance.US’s order book had low volume. The lower volume did help me execute trades without being as concerned about latency, but the bot would execute less often, and trades were smaller overall.

For the time I ran the bot, it ran +230,000 checks and only executed 16 full arbitrage cycles, never exceeding $20 on a spread of around 1%. It was a solid exercise in API integration, order book mechanics, and thinking carefully about execution risk, but it was honestly not very profitable.

Arbitrage Trading Bot for Binance.US - Image 1