Algorithmic Trading Platform

Algorithmic
Precision.
24/7 Execution.

A full-stack, autonomous trading platform built for the Coinbase Advanced Trade ecosystem. Decoupled microservices architecture ensures 99.9% uptime.

Next.js 16Node.jsPostgreSQLWebSocketRedis
Running: 14d 2h 45m

BTC-USD

+2.4%
$64,293.50
24h Volume
12,405 BTC
RSI: 68MACD: Bull
ASKS
64,3100.50
64,3201.00
64,3301.50
BIDS
64,1900.80
64,1801.60
64,1702.40
OPEN ORDERS (2)
BUY LIMIT0.5 BTC @ $63,500Just now

Decoupled Architecture

The Worker runs independently of the web UI, ensuring trades execute reliably even when the browser is closed.

Client (Next.js)
Dashboard UI
API Layer
Server Actions
PostgreSQL
Persistence
Worker Service
Node.js Loop
Coinbase API
External

Mission Critical Features

Built for reliability and performance in high-frequency environments.

Risk Engine

Capital preservation protocols baked into the core. Hard stops, trailing stop-losses, and daily loss limits that trigger auto-shutdown.

Shadow Ledger

Simulates trades with 0.6% fee estimation before risking real capital. Test strategies in a realistic environment.

Real-time Websockets

Low-latency price updates and order status reflection via Coinbase Advanced Trade API streams.

AES-256 Security

API keys are encrypted at rest using AES-256-GCM. Decryption happens only in secure server memory.

Under the Hood

A look at the core logic driving the autonomous decision making.

export class RiskManager {
  private readonly MAX_DAILY_LOSS = 0.05; // 5%

  public async validateTrade(state: PortfolioState): Promise<boolean> {
    const dailyPnL = await this.calculateDailyPnL(state.accountId);
    
    // Hard circuit breaker
    if (dailyPnL < -this.MAX_DAILY_LOSS) {
        await this.emergencyShutdown("Daily loss limit exceeded");
        return false;
    }

    return true;
  }
}

Algorithmic Strategies

Pre-built logic modules that can be hot-swapped into the execution engine.

Momentum RSI

Classic mean reversion. Buys when RSI < 30 (Oversold) and Sells when RSI > 70 (Overbought). Enhanced with trend filters to avoid catching falling knives.

Mean ReversionOscillatorSafe

Grid DCA

Places a mesh of buy orders below the market price to lower average entry cost. Automatically places take-profit orders as positions fill.

AccumulationHigh FrequencyVolatile

Trailing Stop Surfer

Advanced exit strategy. Once a trade is in profit, a dynamic stop-loss follows price peaks, locking in gains while allowing run-ups.

Exit LogicUtilityProfit-Max

Why I Built This

Cryptocurrency markets run 24/7, but humans need sleep. Manual trading is often plagued by emotional decision-making, hesitation, and fatigue.

I wanted to build a system that was cold, calculated, and relentless. CoinBot wasn't just a coding project; it was an attempt to engineer discipline.

Technical Challenges Solved

  • Handling Websocket reconnection logic and heartbeat management.
  • Ensuring idempotency: preventing double-buys with unique client_order_ids.
  • Syncing async Worker state with the Real-time UI.
  • Securely encrypting API keys while making them accessible to the backend.