A sophisticated, production-ready platform for cryptocurrency arbitrage and copy trading, built with modern web technologies and microservices architecture.
- Overview
- Features
- Architecture
- Tech Stack
- Quick Start
- Development
- Deployment
- API Documentation
- Monitoring
- Contributing
- License
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.
- Multi-exchange price monitoring
- Real-time opportunity detection
- Automated execution with configurable parameters
- Risk management and position sizing
- Performance analytics and reporting
- Master trader identification and verification
- Real-time strategy replication
- Customizable risk parameters
- Performance tracking and analytics
- Social features and community building
- Non-custodial architecture
- Multi-factor authentication
- Rate limiting and DDoS protection
- Audit trails and compliance reporting
- Cold storage integration
- Real-time portfolio tracking
- Performance metrics and benchmarking
- Risk analysis and stress testing
- Custom reporting and data export
- API access for third-party integrations
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 โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
- 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
- Framework: React 18+ with TypeScript
- Build Tool: Vite
- Styling: Tailwind CSS
- State Management: React Context + Hooks
- Testing: Vitest
- Package Manager: pnpm
- Runtime: Node.js 18+
- Language: TypeScript
- Framework: Express.js
- Authentication: JWT with refresh tokens
- Database: PostgreSQL 15
- Cache: Redis 7
- Queue: Bull/BullMQ
- Containerization: Docker & Docker Compose
- Reverse Proxy: Nginx
- Monitoring: Prometheus, Grafana, Loki
- SSL/TLS: Let's Encrypt integration
- Process Management: PM2
- Package Manager: pnpm 8.15+
- Linting: ESLint
- Formatting: Prettier
- Git Hooks: Husky
- Testing: Vitest + Testing Library
- 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
-
Clone the repository
git clone https://github.com/your-username/cryonel.git cd cryonel
-
Install dependencies
pnpm install
-
Environment setup
cp env.example .env # Edit .env with your configuration values
-
Start development environment
make dev
-
Access the application
- Web Frontend: http://localhost:3000
- API Gateway: http://localhost:8080
- Database: localhost:5432
- Redis: localhost:6379
# 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
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
-
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"
-
Testing
# Run all tests make test # Run specific test suites cd apps/web && pnpm test cd apps/api && pnpm test
-
Code Quality
# Lint code pnpm lint # Type checking pnpm typecheck # Format code pnpm format
-
Environment Configuration
# Copy and configure environment cp env.example .env # Edit .env with production values
-
Build and Deploy
# Build production images make build # Deploy to production make deploy
-
Verify Deployment
# Check service status make status # View logs make logs
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
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]
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": { ... }
}
# 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"
}
# 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>
The platform includes comprehensive monitoring:
- Prometheus: Metrics collection and storage
- Grafana: Visualization and dashboards
- Loki: Log aggregation and search
- Health Checks: Service health monitoring
- 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
# Grafana Dashboard
http://localhost:3000/grafana
# Prometheus Metrics
http://localhost:3000/prometheus
# Loki Logs
http://localhost:3000/loki
We welcome contributions! Please follow these guidelines:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
- Follow TypeScript best practices
- Use meaningful variable and function names
- Add JSDoc comments for public APIs
- Follow the existing code style
- Write comprehensive tests
- Unit tests for business logic
- Integration tests for API endpoints
- End-to-end tests for critical user flows
- Maintain test coverage above 80%
This project is licensed under the MIT License - see the LICENSE file for details.
- 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
- Port Conflicts: Ensure ports 3000, 8080, 5432, and 6379 are available
- Docker Issues: Verify Docker and Docker Compose are properly installed
- Environment Variables: Check that all required environment variables are set
- Database Connection: Ensure PostgreSQL is running and accessible
# Check service status
make status
# View service logs
make logs
# Restart services
make restart
# Clean and rebuild
make clean
make install
make dev
- 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.)
- Database query optimization
- Caching strategy enhancement
- Load balancing improvements
- Microservices optimization