Skip to main content

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 Design
  • Go + TypeScript + Deno
  • Solana / Raydium / PumpFun
  • Distributed Systems

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.

BRAINGo · Port 8500Geyser MonitorAdaptive EngineInstance MgrWEBSOCKETStabilizer ARaydium CPMMGo ProcessStabilizer BPumpFun AMMGo ProcessStabilizer CCPMM PoolGo ProcessJITO BUNDLESSOLANAYellowstone gRPC

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.

SIGNERDeno RuntimeBIP44 / Ed25519Key DerivationKEYS NEVER LEAVEUnix Socket/tmp/signer.sockORCHESTRATORBun + Hono · Port 3000API + RunnerSchedulerPostgreSQLHTTP APIFRONTENDVite + React · Port 4000Admin DashboardWallet OverviewReal-time StatusIsolated processBusiness logicOperator interfaceJSON-RPC

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.

00:0023:59UTCFetch Revenuefrom Pump.fun2,880 Buy Intervals (30s each)Jupiter V6 API → Jito BundlesTransferto Sink WalletDeterministic SchedulingRandomized AmountsCircuit Breaker Guard

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.

99.9%
Uptime
200+
Daily Operations
100+
Concurrent Wallets

Stack

Go 1.24
Deno (Signer Runtime)
Bun + Hono (Orchestrator)
Vite + React (Frontend)
PostgreSQL + SQLite
Solana-Go SDK
Yellowstone gRPC (Geyser)
Jito Bundle Engine
Jupiter V6 API
gorilla/websocket

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.