← All projects

DCA Trading Bot

A full-stack bot that runs scheduled dollar-cost averaging and RSI-triggered stock and crypto trades through Alpaca's paper trading API.

The need
A bot that trades on its own has to be safe before it is smart: no double buys, no runaway losses, and a clear view of what it is doing at all times.
Result
Runs scheduled and RSI-triggered trades with a kill switch, daily-loss and drawdown limits, trailing stops, crash-safe orders, and a live dashboard.
Stack
TypeScript · Fastify · React · PostgreSQL · Drizzle · WebSockets

A TypeScript monorepo with a Fastify API, a React dashboard, and PostgreSQL through Drizzle. It trades stocks and crypto on Alpaca’s paper trading API, so every rule gets proven before real money is involved.

How it stays safe

  • Risk controls. An automatic kill switch, daily-loss and max-drawdown limits, trailing stops, and bracket orders.
  • Crash-safe orders. Every order carries a unique ID, so a retry can never double buy, and unconfirmed orders are reconciled with Alpaca on restart.
  • Live view. Prices stream in over WebSocket, and the dashboard updates over Server-Sent Events behind JWT auth with refresh-token rotation.