Skip to content

A sophisticated, production-ready platform for cryptocurrency arbitrage and copy trading, built with modern web technologies and microservices architecture.

Notifications You must be signed in to change notification settings

semihbugrasezer/cryonel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ CRYONEL - Non-Custodial Crypto Arbitrage & Copy Trading Platform

License: MIT Node.js pnpm Docker

A sophisticated, production-ready platform for cryptocurrency arbitrage and copy trading, built with modern web technologies and microservices architecture.

๐Ÿ“‹ Table of Contents

๐ŸŽฏ Overview

CRYONEL is a comprehensive platform that enables users to:

  • Arbitrage Trading: Automatically identify and execute profitable arbitrage opportunities across multiple exchanges
  • Copy Trading: Follow and replicate successful traders' strategies in real-time
  • Portfolio Management: Track performance, manage risk, and optimize trading strategies
  • Real-time Analytics: Monitor market conditions, performance metrics, and trading signals

The platform is designed with security, scalability, and user experience in mind, providing a robust foundation for both retail and institutional users.

โœจ Features

๐Ÿ”„ Arbitrage Trading

  • Multi-exchange price monitoring
  • Real-time opportunity detection
  • Automated execution with configurable parameters
  • Risk management and position sizing
  • Performance analytics and reporting

๐Ÿ‘ฅ Copy Trading

  • Master trader identification and verification
  • Real-time strategy replication
  • Customizable risk parameters
  • Performance tracking and analytics
  • Social features and community building

๐Ÿ›ก๏ธ Security & Compliance

  • Non-custodial architecture
  • Multi-factor authentication
  • Rate limiting and DDoS protection
  • Audit trails and compliance reporting
  • Cold storage integration

๐Ÿ“Š Analytics & Reporting

  • Real-time portfolio tracking
  • Performance metrics and benchmarking
  • Risk analysis and stress testing
  • Custom reporting and data export
  • API access for third-party integrations

๐Ÿ—๏ธ Architecture

The platform follows a microservices architecture with the following components:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Web Frontend  โ”‚    โ”‚   API Gateway   โ”‚    โ”‚  Arbitrage     โ”‚
โ”‚   (React/TS)    โ”‚โ—„โ”€โ”€โ–บโ”‚   (Node.js)     โ”‚โ—„โ”€โ”€โ–บโ”‚  Worker        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚                       โ”‚                       โ”‚
         โ”‚                       โ”‚                       โ”‚
         โ–ผ                       โ–ผ                       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Nginx Proxy   โ”‚    โ”‚   PostgreSQL    โ”‚    โ”‚  Copy Trading   โ”‚
โ”‚   (SSL/TLS)     โ”‚    โ”‚   Database      โ”‚    โ”‚  Workers        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚                       โ”‚                       โ”‚
         โ”‚                       โ”‚                       โ”‚
         โ–ผ                       โ–ผ                       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Redis Cache   โ”‚    โ”‚   Prometheus    โ”‚    โ”‚   Grafana       โ”‚
โ”‚   & Queue       โ”‚    โ”‚   Monitoring    โ”‚    โ”‚   Dashboard     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Service Components

  • Web Frontend: React-based SPA with TypeScript and Tailwind CSS
  • API Gateway: Node.js REST API with JWT authentication
  • Arbitrage Worker: Automated arbitrage detection and execution
  • Copy Trading Workers: Master and follower trading logic
  • Database: PostgreSQL for persistent data storage
  • Cache: Redis for session management and job queues
  • Proxy: Nginx for load balancing and SSL termination
  • Monitoring: Prometheus, Grafana, and Loki for observability

๐Ÿ› ๏ธ Tech Stack

Frontend

  • Framework: React 18+ with TypeScript
  • Build Tool: Vite
  • Styling: Tailwind CSS
  • State Management: React Context + Hooks
  • Testing: Vitest
  • Package Manager: pnpm

Backend

  • Runtime: Node.js 18+
  • Language: TypeScript
  • Framework: Express.js
  • Authentication: JWT with refresh tokens
  • Database: PostgreSQL 15
  • Cache: Redis 7
  • Queue: Bull/BullMQ

Infrastructure

  • Containerization: Docker & Docker Compose
  • Reverse Proxy: Nginx
  • Monitoring: Prometheus, Grafana, Loki
  • SSL/TLS: Let's Encrypt integration
  • Process Management: PM2

Development Tools

  • Package Manager: pnpm 8.15+
  • Linting: ESLint
  • Formatting: Prettier
  • Git Hooks: Husky
  • Testing: Vitest + Testing Library

๐Ÿš€ Quick Start

Prerequisites

  • Node.js: 18.0.0 or higher
  • pnpm: 8.15.0 or higher
  • Docker: 20.10.0 or higher
  • Docker Compose: 2.0.0 or higher
  • Git: Latest version

Installation

  1. Clone the repository

    git clone https://github.com/your-username/cryonel.git
    cd cryonel
  2. Install dependencies

    pnpm install
  3. Environment setup

    cp env.example .env
    # Edit .env with your configuration values
  4. Start development environment

    make dev
  5. Access the application

๐Ÿ› ๏ธ Development

Available Commands

# Development
make dev              # Start development environment
make dev-build        # Build development environment (no cache)
make dev-quick        # Quick rebuild web frontend only
make watch            # Start live file watching and auto-deployment

# Building & Deployment
make build            # Build production images
make deploy           # Deploy to production
make prod-deploy      # Build and deploy to production

# Management
make start            # Start all services
make stop             # Stop all services
make restart          # Restart all services
make status           # Show service status

# Development Tools
make web-shell        # Get shell access to web container
make api-shell        # Get shell access to API container
make db-shell         # Get shell access to database
make redis-shell      # Get shell access to Redis

# Utilities
make logs             # Show logs from all services
make clean            # Clean up Docker images and containers
make backup           # Create backup of current state
make test             # Run tests

Project Structure

cryonel/
โ”œโ”€โ”€ apps/                    # Application services
โ”‚   โ”œโ”€โ”€ web/                # React frontend application
โ”‚   โ”‚   โ”œโ”€โ”€ src/            # Source code
โ”‚   โ”‚   โ”œโ”€โ”€ public/         # Static assets
โ”‚   โ”‚   โ”œโ”€โ”€ dist/           # Build output
โ”‚   โ”‚   โ””โ”€โ”€ package.json    # Frontend dependencies
โ”‚   โ”œโ”€โ”€ api/                # Node.js API service
โ”‚   โ”‚   โ”œโ”€โ”€ src/            # Source code
โ”‚   โ”‚   โ”œโ”€โ”€ scripts/        # Utility scripts
โ”‚   โ”‚   โ””โ”€โ”€ package.json    # API dependencies
โ”‚   โ””โ”€โ”€ workers/            # Background worker services
โ”‚       โ”œโ”€โ”€ arb/            # Arbitrage worker
โ”‚       โ”œโ”€โ”€ copy-master/    # Copy trading master worker
โ”‚       โ””โ”€โ”€ copy-follower/  # Copy trading follower worker
โ”œโ”€โ”€ infra/                  # Infrastructure configuration
โ”‚   โ”œโ”€โ”€ db/                 # Database initialization
โ”‚   โ”œโ”€โ”€ nginx/              # Nginx configuration
โ”‚   โ”œโ”€โ”€ postgres/           # PostgreSQL configuration
โ”‚   โ”œโ”€โ”€ redis/              # Redis configuration
โ”‚   โ”œโ”€โ”€ prometheus/         # Monitoring configuration
โ”‚   โ”œโ”€โ”€ grafana/            # Dashboard configuration
โ”‚   โ””โ”€โ”€ loki/               # Log aggregation
โ”œโ”€โ”€ nginx/                  # Nginx proxy configuration
โ”œโ”€โ”€ logs/                   # Application logs
โ”œโ”€โ”€ scripts/                # Utility scripts
โ”œโ”€โ”€ docker-compose.yml      # Production services
โ”œโ”€โ”€ docker-compose.dev.yml  # Development services
โ”œโ”€โ”€ Makefile                # Development commands
โ”œโ”€โ”€ package.json            # Root package configuration
โ””โ”€โ”€ .env                    # Environment variables

Development Workflow

  1. Feature Development

    # Create feature branch
    git checkout -b feature/your-feature-name
    
    # Start development environment
    make dev
    
    # Make changes and test
    # Use make watch for auto-deployment
    
    # Run tests
    make test
    
    # Commit changes
    git add .
    git commit -m "feat: add your feature description"
  2. Testing

    # Run all tests
    make test
    
    # Run specific test suites
    cd apps/web && pnpm test
    cd apps/api && pnpm test
  3. Code Quality

    # Lint code
    pnpm lint
    
    # Type checking
    pnpm typecheck
    
    # Format code
    pnpm format

๐Ÿš€ Deployment

Production Deployment

  1. Environment Configuration

    # Copy and configure environment
    cp env.example .env
    # Edit .env with production values
  2. Build and Deploy

    # Build production images
    make build
    
    # Deploy to production
    make deploy
  3. Verify Deployment

    # Check service status
    make status
    
    # View logs
    make logs

Environment Variables

Key environment variables for production:

# Security
ENCRYPTION_MASTER_KEY=your-256-bit-encryption-key
JWT_SECRET=your-jwt-secret-key
JWT_REFRESH_SECRET=your-refresh-secret-key

# Database
POSTGRES_USER=your-db-user
POSTGRES_PASSWORD=your-secure-password
POSTGRES_DB=your-database-name

# External Services
GOOGLE_CLIENT_ID=your-google-oauth-id
GOOGLE_CLIENT_SECRET=your-google-oauth-secret
STRIPE_SECRET_KEY=your-stripe-secret-key

# Blockchain
SOLANA_RPC_PRIMARY=your-solana-rpc-endpoint
SOLANA_RPC_FALLBACK=your-fallback-rpc-endpoint

Docker Deployment

The platform uses Docker for containerization:

# Production deployment
docker-compose up -d

# Development deployment
docker-compose -f docker-compose.dev.yml up -d

# View running containers
docker-compose ps

# View logs
docker-compose logs -f [service-name]

๐Ÿ“š API Documentation

Authentication

All API endpoints require JWT authentication:

# Login
POST /api/auth/login
{
  "email": "user@example.com",
  "password": "password"
}

# Response
{
  "accessToken": "jwt-access-token",
  "refreshToken": "jwt-refresh-token",
  "user": { ... }
}

Trading Endpoints

# Get arbitrage opportunities
GET /api/arbitrage/opportunities
Authorization: Bearer <access-token>

# Execute arbitrage trade
POST /api/arbitrage/execute
Authorization: Bearer <access-token>
{
  "opportunityId": "uuid",
  "amount": "1000",
  "strategy": "triangular"
}

# Get copy trading strategies
GET /api/copy-trading/strategies
Authorization: Bearer <access-token>

# Follow a strategy
POST /api/copy-trading/follow
Authorization: Bearer <access-token>
{
  "strategyId": "uuid",
  "allocation": "0.1"
}

Portfolio Management

# Get portfolio overview
GET /api/portfolio/overview
Authorization: Bearer <access-token>

# Get performance metrics
GET /api/portfolio/performance?period=30d
Authorization: Bearer <access-token>

# Get transaction history
GET /api/portfolio/transactions?page=1&limit=50
Authorization: Bearer <access-token>

๐Ÿ“Š Monitoring

Metrics Collection

The platform includes comprehensive monitoring:

  • Prometheus: Metrics collection and storage
  • Grafana: Visualization and dashboards
  • Loki: Log aggregation and search
  • Health Checks: Service health monitoring

Key Metrics

  • Trading Performance: P&L, win rate, Sharpe ratio
  • System Health: Response times, error rates, throughput
  • Infrastructure: CPU, memory, disk usage
  • Security: Failed login attempts, rate limit violations

Accessing Dashboards

# Grafana Dashboard
http://localhost:3000/grafana

# Prometheus Metrics
http://localhost:3000/prometheus

# Loki Logs
http://localhost:3000/loki

๐Ÿค Contributing

We welcome contributions! Please follow these guidelines:

Development Setup

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass
  6. Submit a pull request

Code Standards

  • Follow TypeScript best practices
  • Use meaningful variable and function names
  • Add JSDoc comments for public APIs
  • Follow the existing code style
  • Write comprehensive tests

Testing Guidelines

  • Unit tests for business logic
  • Integration tests for API endpoints
  • End-to-end tests for critical user flows
  • Maintain test coverage above 80%

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ†˜ Support

Getting Help

  • Documentation: Check this README and inline code comments
  • Issues: Report bugs and feature requests via GitHub Issues
  • Discussions: Join community discussions on GitHub
  • Security: Report security vulnerabilities privately

Common Issues

  1. Port Conflicts: Ensure ports 3000, 8080, 5432, and 6379 are available
  2. Docker Issues: Verify Docker and Docker Compose are properly installed
  3. Environment Variables: Check that all required environment variables are set
  4. Database Connection: Ensure PostgreSQL is running and accessible

Troubleshooting

# Check service status
make status

# View service logs
make logs

# Restart services
make restart

# Clean and rebuild
make clean
make install
make dev

๐Ÿ”ฎ Roadmap

Upcoming Features

  • Advanced risk management tools
  • Machine learning-based opportunity detection
  • Mobile application (React Native)
  • Institutional trading features
  • Advanced analytics and reporting
  • Multi-chain support (Ethereum, Polygon, etc.)

Performance Improvements

  • Database query optimization
  • Caching strategy enhancement
  • Load balancing improvements
  • Microservices optimization

About

A sophisticated, production-ready platform for cryptocurrency arbitrage and copy trading, built with modern web technologies and microservices architecture.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •