Shipping Crypto-to-Crypto on Binance
CoinSwitch only supported fiat-to-crypto trades. Adding crypto-to-crypto meant integrating directly with Binance's trading engine. I owned this end-to-end — from API design to cross-team coordination — resulting in a 2.77% increase in cryptocurrency market share.
System Architecture
┌──────────┐ ┌──────────────┐ ┌───────────────┐
│ Mobile │───▶│ CoinSwitch │───▶│ Binance │
│ App │ │ Gateway │ │ Exchange │
└──────────┘ └──────┬───────┘ └───────┬───────┘
│ │
┌──────▼───────┐ ┌──────▼───────┐
│ Order │◀────▶│ Binance │
│ Management │ │ WebSocket │
│ Service │ │ (Price) │
└──────┬───────┘ └──────────────┘
│
┌──────────┼──────────┐
│ │ │
┌─────▼────┐ ┌──▼───┐ ┌───▼────┐
│ Validate │ │Match │ │Settle │
│ Order │ │Order │ │ Trade │
└──────────┘ └──────┘ └────────┘
Key Challenges
Price Volatility
Crypto prices can move 5% in seconds. The system locks the price at order creation and has a configurable TTL (time-to-live). If the order isn't executed within the window, it's automatically cancelled and the user gets a fresh quote.
Binance Rate Limits
Binance enforces strict rate limits per IP and per account. The system uses a priority queue for order execution — market orders get priority over limit orders, and the rate limiter (the same library I built) ensures we never exceed Binance's thresholds.
Cross-team Coordination
This touched the mobile team, risk team, compliance, and finance. I set up weekly syncs, wrote a detailed RFC, and maintained a shared Notion doc with the complete state machine for crypto-to-crypto order lifecycle.
Order State Machine
CREATED ──▶ VALIDATING ──▶ MATCHING ──▶ SETTLING ──▶ COMPLETED
│ │ │ │
└─── CANCELLED ◀─────── FAILED ◀─────────┘
Impact
2.77% increase in crypto market share. The feature shipped in 6 weeks and has since processed millions of crypto-to-crypto transactions on the platform.