Distributed Trading Infrastructure
High-performance market-making infrastructure for Solana. A Go-based central controller orchestrates distributed executor instances via WebSockets, leveraging Yellowstone gRPC for low-latency data and Jito-bundled transactions for MEV-protected execution.
Architecture
The Brain service acts as the central control plane, consuming real-time Solana state via Yellowstone gRPC streams. Upon meeting specific market triggers, it spawns standalone Go processes (Stabilizers) that maintain WebSocket connections for command and control. Each Stabilizer is scoped to a specific AMM pool, executing trades through Jito MEV-protected bundles to minimize slippage and sandwich risk. Local state and audit logs are persisted in SQLite with WAL journaling.
Wallet Isolation
Security is enforced through process isolation: key material is restricted to a dedicated Deno Signer, accessible only via a local Unix domain socket. The Signer performs in-memory BIP44/Ed25519 derivation, wiping secrets immediately after signature generation. Business logic and task scheduling are managed by a Bun/Hono Orchestrator backed by PostgreSQL. A Vite-based React frontend provides real-time monitoring of wallet balances and transaction history.
TWAP Execution
The TWAP engine executes 24-hour buyback cycles based on real-time revenue data from the Pump.fun fee API. Each cycle pre-generates 2,880 execution intervals at 30-second increments, with randomized amounts and timing jitter to minimize predictable market impact. Swaps route through the Jupiter V6 API for optimal liquidity, with daily settlements transferred to a secure sink wallet via SPL Token-2022 instructions.
Reliability
The system maintains 99.9% uptime across 200+ daily operations and 100+ concurrent wallets. Circuit breakers halt trading when anomalies exceed configurable thresholds. Automated reconciliation verifies on-chain state against expected balances. Geyser stream watchdogs detect stale connections within 30 seconds and reconnect automatically.
Stack
Outcomes
Seven interconnected repositories forming a complete trading infrastructure. 1,304 test specs across the system with circuit breakers, automated reconciliation, and graceful degradation ensuring continuous operation in volatile market conditions.