Skip to content

Ryan-Diep/crypto-arbitrage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crypto Arbitrage Monitor

Real-time cryptocurrency arbitrage detection system across Coinbase, Binance, Bybit, OKX image image

Architecture

graph LR
    A[Go Producer] -->|High Throughput| B(Kafka)
    B --> C[Java Consumer]
    C -->|REST API| D[React Dashboard]
    E[Coinbase] --> A
    F[Binance] --> A
    G[Bybit] --> A
    H[OKX] --> A
Loading

Prerequisites

  • Go 1.21+
  • Java 17+
  • Node.js 18+
  • Docker & Docker Compose
  • Maven

Quick Start

1. Start Kafka

docker-compose up -d

2. Setup API Keys

Create a .env file in the root directory. Only Coinbase requires API keys for public ticker data.

COINBASE_API_KEY=your_api_key
COINBASE_SECRET_KEY=-----BEGIN EC PRIVATE KEY-----
your_secret_key
-----END EC PRIVATE KEY-----

3. Start Producer (Go)

The producer automatically discovers symbols that exist on at least 2 exchanges and streams them.

cd producer
go mod download
go run cmd/main.go

4. Start Consumer (Java)

The consumer detects N-way arbitrage opportunities between any pair of exchanges.

cd consumer
mvn clean install
mvn spring-boot:run

5. Start Web Dashboard (React)

cd webapp
npm install
npm start

Visit http://localhost:3000 to see the live dashboard!

Features

  • Multi-Exchange Support: Tracks Coinbase, Binance, Bybit, and OKX simultaneously.
  • Smart Auto-Discovery: Finds assets listed on ≥2 exchanges.
  • High-Frequency Streaming: Handles 1,000+ messages/sec via Kafka.
  • N-Way Arbitrage: Detects best BUY and SELL opportunities.
  • Live Dashboard: Real-time price feeds, dynamic search, visual spread indicators.
  • Resilience: Automatic reconnection logic for WebSockets and Kafka.

API Endpoints

  • GET http://localhost:8081/api/opportunities – Returns top arbitrage opportunities.
  • GET http://localhost:8081/api/prices – Returns live prices for all tracked symbols.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors