Solana DEX aggregator UI with real-time order routing and live order books.
- Role
- Senior Frontend Engineer
- Timeline
- May 2023 – Aug 2024 · 15 months
The brief
DFlow is a decentralized order-flow marketplace on Solana — a DEX aggregator that routes trades across on-chain liquidity. For high-frequency, on-chain traders, latency is the product: a 200 ms lag in the order book or a mispriced route is a complaint, not a detail. The brief was to build the trading UI from scratch — live order books, optimal routing, price-impact visibility and wallet signing — fast and trustworthy enough that traders would move real size through it.
Architecture
I built the frontend from the ground up around a real-time data model. A WebSocket layer streams order books and price feeds into a store tuned to keep the UI responsive under a constant firehose of updates, while Solana wallet integration handles on-chain signing and routing execution. The hard part isn't drawing an order book — it's keeping it correct and at sub-perceptible latency while the chain and the market move underneath you. E2E and unit tests guard the money-path so a refactor never ships a wrong number.
System
- Real-time data pipeline over WebSockets — order books and price feeds stream into a normalized store, decoupled from render, so the UI stays responsive under a firehose of updates.
- On-chain execution through the Solana wallet flow — routing and transaction signing happen client-side against on-chain liquidity, with price impact computed before the user commits.
- Money-path test coverage with Cypress and Jest in Docker — the order and routing logic is the part you can't get wrong, so it carries the most tests.
- Latency-aware, optimistic UI — local state reflects intent immediately and reconciles with chain confirmations, so the interface never feels like it's waiting on the network.
What shipped
- A from-scratch DEX trading UI: live order books, order routing and price-impact visualization.
- Solana wallet integration with on-chain transaction signing and routing execution.
- A WebSocket-driven real-time data layer feeding live prices and book depth.
- End-to-end and unit test coverage (Cypress + Jest) on the order and routing path, running in Docker.
Results & impact
- Kept the order book responsive under live market load — fast enough for traders who treat 200 ms of lag as a bug, not a nitpick.
- Gave traders a from-scratch surface they could move real size through, with on-chain routing and signing they could trust.
- Guarded the order and routing path with Cypress and Jest coverage, so refactors shipped without touching the money-path.
