Skip to content

tmythicator/ticker-rush

Repository files navigation

Ticker Rush

Backend Status Frontend Status Built With Nix

Overview

Ticker Rush is a high-performance, real-time stock trading simulator. The project's core mission is to make the experience of trading stocks enjoyable and risk-free. It provides a platform where users can have fun while learning market dynamics without financial exposure.

Participants start with equal virtual budgets and trade stocks and ETFs. The primary objective is to maximize portfolio value and compete for the top of the leaderboard.

Showcase

ticker-rush-demo.mp4

Project Scope & Roadmap

Ticker Rush is evolving from a core simulator to a fully featured trading ecosystem.

Phase 1: Core Simulator (MVP)

  • High-performance trade execution engine (Go).
  • Real-time market data streaming via SSE.
  • Secure authentication (HttpOnly Cookie + JWT).
  • Versioned Protobuf API contracts (v1).
  • Basic Interactive Dashboard (React).

Phase 2: Advanced Trading & Social [Current]

  • Global Leaderboards & Social Profiles.
  • Multi-asset support (Options, Crypto).
  • Portfolio Performance Analytics.

Phase 3: AI-Driven Ecosystem

  • Competitive AI Trading Agents (LangChain + Bun).
  • Natural Language Trading Interface.
  • Automated Strategy Backtesting.

Architecture

Ticker Rush uses a Microservices Architecture within a Monorepo setup:

  • Structure: A single repository (Monorepo) holds all services, ensuring atomic changes across the stack and shared tooling (Nix, Taskfile).
  • Execution: At runtime, services act as independent Microservices orchestrated via docker-compose (Production) or process-compose (Development).
  • Backend: Go services built with the Gin web framework.
    • API/Exchange: High-performance trading logic and user management.
    • Data Fetcher: Real-time market data ingestion and processing.
    • Persistence: PostgreSQL using sqlc and goose.
    • Real-time: Server-Sent Events (SSE) for sub-second updates.
  • Bot (WIP): A lightweight trading agent built with Bun, TypeScript, and LangChain.
  • Frontend: Modern React 19 + TypeScript + TanStack Query.
  • Infrastructure: Valkey for caching and Nix Flakes for reproducibility.

Authentication

Ticker Rush implements a secure HttpOnly Cookie + JWT authentication strategy:

  • JWT: Used for stateless session management.
  • HttpOnly Cookies: Prevents XSS attacks by keeping tokens inaccessible to client-side scripts.
  • Stateless: The backend remains lean and scalable.

Protobuf & Type Safety

We use Protocol Buffers (Protobuf) as the single source of truth for all API contracts:

  • Source: Definitions are located in versioned subdirectories within proto/ (e.g., proto/exchange/v1/).
  • Generation: We use Buf to generate type-safe code for all languages:
    • Go: Generated in backend/internal/proto/.
    • TypeScript (Frontend): Generated in frontend/src/lib/proto/.
    • TypeScript (Bot): Generated in bot/src/lib/proto/.
  • Consistency: This ensures that a change in the schema is automatically propagated across the entire stack, preventing runtime type mismatches.

Quick Start

The recommended way to start development is using Nix:

  1. Bootstrap (First time only):
    chmod +x scripts/bootstrap.sh
    ./scripts/bootstrap.sh
  2. Develop:
    nix develop
    task init
    task dev

For detailed configuration and testing guidelines, refer to CONTRIBUTING.md.

License

GNU Affero General Public License v3.0 (AGPL-3.0) — see LICENSE.

AGPLv3 ensures that Ticker Rush remains open-source. If you run a modified version as a network service, you must share the corresponding source code with your users.

About

Real-time stock ladder simulation platform

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published