Algorithmic Trading Platform for Multi-Exchange Crypto Execution

Azati joined an early-stage algorithmic trading platform as the core engineering partner and over 15 months transformed it from a single-threaded prototype into a production-grade system refactoring the computation core, integrating six CEX and DEX exchanges, building ML-driven adaptive risk logic, and cutting backtesting time from 10 hours to under 2 hours on million-parameter runs.

Discuss your project
5x

faster backtesting from 8-10 hours to 1-2 hours per million-parameter run

2x

increase in strategy PnL after adaptive logic integration

40%

reduction in maximum drawdown after ML-driven risk management deployment

Technologies used

Python
Python
PostgreSQL
PostgreSQL
Redis
Redis
AWS
AWS
FastAPI
FastAPI
Celery
Celery
Pandas
Pandas
NumPy
NumPy
Matplotlib
Matplotlib
Scikit-Learn
Scikit-Learn
Scipy
Scipy

Motivation

Algorithmic trading at scale is an engineering problem as much as a financial one. US-based boutique trading firm had a working prototype strategies, basic exchange connectivity, a backtesting loop but the system couldn't keep up with the demands of real trading operations. Synchronous computations meant that a single backtesting run over a million parameters took the better part of a working day. There was no parallel processing, no adaptive risk logic, and no path to adding new exchanges or strategy features without the codebase becoming unmanageable.

Azati joined as the core engineering partner with a brief to refactor, scale, and extend the platform taking it from a functional prototype to a production-grade trading infrastructure capable of running continuously, handling large data volumes, and executing across multiple venues simultaneously.

Business challenges

Challenge 01

Synchronous computation bottleneck killing strategy iteration speed

The original backtesting engine ran synchronously, making serious quantitative research practically impossible. A single optimization run required testing:

  • Million-parameter strategy combinations
  • Monte Carlo simulation consistency checks
  • Rolling CAGR performance calculations
  • Multi-timeframe signal validation
  • Edge-case scenario coverage
  • Percentile spread analysis across simulation outcomes
#1
Challenge 02

Static risk logic unable to adapt to market conditions

Every trade was treated identically regardless of market context. The system had no mechanism to recognize regime changes and adjust accordingly:

  • Hardcoded Stop-Loss and Take-Profit levels
  • Fixed leverage settings per instrument
  • No market state classification
  • No dynamic position sizing
  • No cooldown logic between trade signals
  • No re-entry mechanism after SL/TP trigger
#2
Challenge 03

Growing exchange ecosystem with incompatible APIs

Each venue required its own integration approach, error handling, and data normalization layer. Reliable multi-exchange execution had to account for:

  • Different API architectures per exchange
  • Per-exchange rate limiting and IP ban risks
  • On-chain DEX execution via Web3 smart contracts
  • Real-time position tracking across venues
  • Divergent data formats and timestamp handling
#3
Challenge 04

Large-scale data volumes with high-frequency ingestion

The platform had to process and store tick-by-tick trade data continuously while keeping backtesting queries fast across a growing dataset:

  • 340 million candle records and growing
  • Real-time tick ingestion from multiple WebSocket feeds
  • Alternative bar construction from raw tick data
  • High-throughput writes without connection overflow
  • Distributed storage and retrieval across AWS S3
#4

The client's requirements

The client needed a senior Python engineer who could step into an existing codebase, understand the trading domain quickly, and start delivering improvements immediately. The scope evolved over 15 months from focused refactoring into full-platform engineering ownership. Specifically:

  • Refactor and optimize the backtesting engine to support parallel computation and dramatically reduce run times
  • Integrate additional exchanges both centralized futures venues and decentralized on-chain execution
  • Build ML-based adaptive trading logic that adjusts risk parameters dynamically based on recognized market conditions
  • Design and implement a high-frequency tick data ingestion and processing pipeline
  • Develop a Command and Control interface for real-time operator intervention without interrupting live trading
  • Maintain and support the production system as the sole Azati engineer on the project

Why Azati?

Python engineering depth matched to a demanding domain

Algorithmic trading infrastructure demands more than general backend skills it requires comfort with numerical computing, high-throughput data pipelines, async execution, and financial data structures. The Azati engineer brought hands-on experience with the full Python scientific and async stack (Numba, Celery, Pandas, NumPy, Optuna) and absorbed the trading domain specifics quickly enough to contribute from the start.

Quantitative research capability alongside engineering

The project wasn't just about writing fast code it required understanding and implementing quantitative research methods: Monte Carlo simulation, clustering algorithms, rolling CAGR, tick bar construction. Azati provided an engineer capable of both implementing these methods correctly and adapting them to the client's evolving strategy requirements.

Long-term embedded ownership, not a handoff

Over 15 months, the Azati engineer became the primary technical owner of the platform the person who knows the codebase, understands the trading logic, and is responsible for keeping production running. This level of continuity and accountability is what the client needed; not a project delivery, but a reliable engineering partner embedded in their operations.

Delivery under real operational constraints

The platform runs live trading with real capital. Changes had to be tested and deployed without disrupting active positions. The team worked within the client's Trello-based lightweight process, communicated through Discord and Telegram, and maintained production stability throughout 15 months of continuous development.

Building a trading system that needs to perform under pressure?

Whether you need to scale an existing algo trading platform or build one from the ground up, Azati brings the quantitative and engineering depth to do it right.

Let's discuss your trading infrastructure

Solution

01

Multi-Exchange Integration and Order Execution

The platform was extended to support six trading venues each with its own API architecture, WebSocket protocol, and data format. Integrations cover the full order lifecycle: placing, canceling, and tracking Market, Limit, and Conditional orders; real-time position and balance monitoring via dedicated WebSocket streams; and per-instrument leverage and margin mode management.

On-chain DEX execution via Uniswap v3 was integrated through Web3, including smart contract interaction (Quoter, SwapRouter), ABI management, and on-chain transaction signing.

Key capabilities:
  • Binance (USDS-M & COIN-M Futures), Bybit (Linear & Inverse), OKX (SWAP), Deribit (Futures), HyperLiquid (Perpetuals)
  • Uniswap v3 DEX execution via Web3 with on-chain transaction signing
  • Full order lifecycle management across all venues
  • Real-time position and balance tracking via WebSocket streams
02

Backtesting Engine Optimization and Parallelization

The original synchronous backtesting engine was refactored from the ground up. Parallel data loading distributes computation across multiple servers, connection pooling prevents database overflow under high write loads, and the optimization formula was overhauled to focus on robust performance metrics rather than raw profit.

Monte Carlo simulation consistency was introduced as a primary optimization target, static equity calculation was replaced with rolling CAGR, and the objective function now incorporates spread between the 1st and 99th percentile simulation outcomes to penalize fragile strategies.

Key capabilities:
  • Parallel computation reduced million-parameter backtesting from 8-10 hours to 1-2 hours
  • Monte Carlo simulation consistency as primary optimization criterion
  • Rolling CAGR replacing static equity for more realistic performance measurement
  • Connection pooling for high-throughput database writes across 340M+ candle records
03

ML-Based Adaptive Risk Management

Instead of hardcoded SL/TP levels and fixed leverage, the system now recognizes the current market state using clustering algorithms (DBSCAN and Hierarchical Clustering) applied to normalized OHLC data.

Before each trade entry, the system identifies which market pattern cluster the current conditions fall into and dynamically adjusts position sizing, leverage, and SL/TP levels accordingly. This adaptive approach reduced maximum drawdown from 35% to 21% and doubled strategy PnL after deployment to production.

Key capabilities:
  • DBSCAN and Hierarchical Clustering for market pattern recognition
  • Dynamic leverage and equity adjustment per identified market cluster
  • Dynamic SL/TP levels adjusted on a per-bar basis
  • Cooldown logic and fishing re-entry mechanism with configurable parameters
04

High-Frequency Tick Data Pipeline

A real-time data ingestion engine was built to process raw tick-by-tick trade data directly from exchange WebSocket streams. The pipeline constructs multiple bar types from the tick feed: standard OHLCV candles at various timeframes and Renko charts that filter time-based noise and focus signal generation purely on price movement.

Large datasets are stored in Apache Feather columnar format and distributed via AWS S3, with the database currently holding approximately 340 million candle records and growing continuously.

Key capabilities:
  • Real-time tick ingestion from exchange WebSocket streams
  • Renko chart construction to eliminate time-based noise
  • Volatility coefficients and relative candle position features for strategy weighting
  • Apache Feather + AWS S3 for high-performance data storage and distribution
05

Command and Control Interface (Discord + Telegram)

Two operator interfaces were built to give the trading team real-time visibility and control over the live system. The Discord bot functions as a full Command and Control console operators can open and close positions, adjust leverage, modify trading parameters, and monitor system state through structured CLI commands without touching the codebase or interrupting the trading core.

The Telegram bot handles signal broadcasting: entry signals, TP/SL levels, and daily parameter updates are pushed automatically to subscribers.

Key capabilities:
  • Discord C2 interface for real-time trade execution and parameter adjustment
  • Live system state monitoring without interrupting trading core
  • Telegram bot for signal broadcasting and daily parameter updates
  • Operator intervention capability without codebase access required

Major achievements

Metric / areaBefore engagement with AzatiAfter engagement with Azati
Backtesting speed (1M parameters)8-10 hours per run1-2 hours per run (5x improvement)
Strategy PnLBaseline2x increase after adaptive logic deployment
Maximum drawdown35%21% after ML risk management integration
Risk managementStatic hardcoded SL/TP and leverageDynamic per-cluster adaptive adjustment
Exchange coverageLimited initial integrations6 venues: 5 CEX + Uniswap v3 DEX
Operator controlNo real-time intervention capabilityFull C2 via Discord bot in production

Security

The platform complies with KYC/AML requirements of Tier-1 exchanges (Binance, OKX, Bybit), ensuring corporate trading accounts operate within platform policies with elevated volume and order limits. A strict API rate limiter governs all exchange requests and WebSocket connections even during extreme volatility, the system cannot exceed requests-per-second limits or trigger IP bans. Built-in circuit breakers enforce hard limits on single-trade volume, maximum leverage relative to pool liquidity, and automatic cooldown on daily drawdown limit breach or data integrity failure from exchange sockets.

Engagement & delivery

T&M with continuous long-term ownership

The engagement runs on a Time & Material basis and has been active for 15 months with no defined end date. The Azati engineer is now the sole developer maintaining and extending the production platform a level of ownership that goes well beyond typical project delivery.

Lightweight process matched to a small trading team

The client's team is small and moves fast. Work was tracked in Trello with minimal ceremony, communication happened through Discord and Telegram, and the development process stayed close to the actual trading operations:

  • Tasks tracked in Trello, prioritized directly by the client
  • Discord used for both operator control and day-to-day engineering communication
  • Production changes coordinated around live trading to avoid position disruption
  • Continuous delivery with no fixed sprint boundaries

Results & business impact

Strategy PnL Doubled

After the adaptive ML risk management logic was deployed to production, strategy PnL increased by 2x. The system now adjusts position sizing and risk parameters based on recognized market conditions rather than applying uniform settings to every trade.

Drawdown Cut from 35% to 21%

Maximum drawdown fell significantly after the cluster-based dynamic SL/TP and leverage system went live particularly during market regime transitions where static risk parameters historically caused the largest losses.

Research Cycle Accelerated 5x

Backtesting a million-parameter run now takes 1-2 hours instead of 8-10. This directly affects how quickly the trading team can test hypotheses, validate strategies, and iterate on their quantitative research.

Production-Ready Multi-Venue Execution

The platform now executes live trades across five centralized futures exchanges and Uniswap v3 on-chain, with full order lifecycle management and real-time position tracking on each venue.

Operational Control Without Engineering Dependency

The Discord C2 interface gives the trading team direct control over live positions and parameters without needing to modify code or deploy changes reducing operational risk and response time during fast-moving market conditions.

Strategic wins

Beyond the measurable results, the engagement produced several capabilities that compound in value over time:

Monte Carlo as a fitness function, not just a validation tool

Replacing profit maximization with Monte Carlo consistency as the primary backtesting objective was a fundamental shift in how strategies are evaluated. It directly targets the overfitting problem strategies that score well must be robust across simulated variations, not just optimized for historical data. This methodology is now embedded in the platform's research workflow.

Tick data as a first-class infrastructure asset

Building a tick ingestion pipeline and storing data in Apache Feather format on S3 gave the platform a foundational data asset that enables more sophisticated strategy research. With 340 million candle records and growing, the infrastructure now supports backtesting at a fidelity level that wasn't possible before.

Cluster-aware trading logic as a reusable pattern

The ML clustering approach to market state recognition normalize historical data, identify recurring patterns, map patterns to risk parameters is a generalizable pattern applicable to any strategy the client develops going forward. It's not a one-off feature but an architectural capability baked into how the platform handles trade entry.

Renko bars as a noise filter for signal generation

Implementing Renko chart construction directly from the tick stream gave the platform an alternative data representation that eliminates time-based noise entirely. For strategies that respond to price movement rather than time intervals, this provides a materially cleaner signal input and the infrastructure to generate it in real time is already in place.

Team composition

A lean team covered the engagement, with the core Python/ML engineer remaining as the sole Azati presence on the project for the majority of its duration.

  • Python / ML Engineer (ongoing) primary technical owner for 15 months. Responsible for all refactoring, exchange integrations, ML feature development, backtesting optimization, tick data pipeline, and production support. Currently the sole developer maintaining and extending the live platform.
  • Python Backend Developer (earlier phase) contributed to initial backend work during the platform's earlier development phase.
  • DevOps Engineer (part-time) supported AWS infrastructure setup, EC2/ECS configuration, and deployment pipeline work.

Last updated

Got a job for Azati? Let’s talk business!

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

What's next?

  • 1. Tell Us Your Story
    Share your project details. We'll connect within 24 hours and ensure confidentiality with an NDA.
  • 2. Get Your Roadmap
    Receive a detailed proposal with scope, team composition, timeline, and costs tailored to your goals.
  • 3. Start Building
    Azati aligns on details, finalize terms, and launch your project with full transparency.