Loading video player...
A high-performance order execution engine built for Solana DEXs. It routes orders to the best liquidity pool (Raydium or Meteora) and executes them using a scalable, asynchronous architecture. We chose Market Orders as the primary order type to focus on speed and immediate execution logic. API Layer (Fastify): Handles high-throughput submission. Upgrades connection to WebSocket for real-time status updates (pending - routing - confirmed). Queue (BullMQ + Redis): Decouples submission from execution. This allows the API to handle spikes (proved 100+ req/min) while workers process orders reliably with exponential backoff. DEX Aggregator: Queries Raydium (API/SDK) and Meteora (DLMM SDK) to find the best quote. Note: For Devnet, valid pools are scarce, so the system includes a smart "Mock Fallback" that simulates mainnet-like liquidity if devnet pools are empty. Worker: Processes orders from the queue, performs the swap, and publishes events via Redis Pub/Sub to the WebSocket. --- Tech Stack --- Runtime: Node.js + TypeScript Server: Fastify (HTTP + WebSocket) Queue: BullMQ (Redis) Database: PostgreSQL (Prisma ORM) Solana: @solana/web3.js, @raydium-io/raydium-sdk, @meteora-ag/dlmm