Skip to content
Β 
Β 

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Sniper-RS: High-Frequency Trading Bot Framework

Rust License Build Status Coverage Chat

Sniper-RS is a production-ready, microservices-based trading bot framework designed for high-frequency trading across multiple venues including DEXs, NFT markets, and CEXs. Built with Rust for unmatched performance and memory safety, it provides a robust foundation for developing sophisticated trading strategies with enterprise-grade features.

🎯 Why Sniper-RS?

  • πŸš€ High Performance: Built with Rust for speed and safety
  • πŸ”§ Multi-Venue Support: Trade on DEXs, NFT markets, and CEXs
  • πŸ—οΈ Microservices Architecture: Scalable and maintainable design
  • πŸ›‘οΈ Enterprise Security: Key isolation, mTLS, and RBAC
  • πŸ“Š Comprehensive Monitoring: Prometheus, OpenTelemetry, and alerting
  • πŸ“‹ Compliance Ready: Geo, venue, and KYC policy engines

πŸš€ Key Features

πŸ—οΈ Architecture

  • Microservices Design: 20+ independently deployable services
  • Event-Driven: NATS/Kafka message bus for high-throughput communication
  • gRPC Integration: High-performance service-to-service communication
  • Cross-Chain Support: Ethereum, BSC, Polygon and other EVM-compatible chains
  • Cloud-Native: Docker and Kubernetes deployment configurations

πŸ’Ή Trading Capabilities

  • Multi-Venue Trading: Support for DEXs, NFT markets, and CEXs
  • Advanced Signal Processing: On-chain event monitoring and off-chain data feeds
  • Strategy Engine: Multiple strategy types including launch sniping and liquidity trading
  • Risk Management: Honeypot detection, owner power analysis, and position limits
  • Execution Engine: Multiple modes including MEV bundle submission
  • Exit Strategies: Take profit, stop loss, and trailing stop mechanisms

πŸ”§ Technical Features

  • CEX Integration: REST and WebSocket clients for major exchanges
  • Monitoring & Telemetry: Prometheus metrics, OpenTelemetry tracing, and alerting
  • Storage & Persistence: Database storage with position tracking and idempotency
  • Distributed Locks: Redis-based locks to prevent duplicate actions
  • Policy Engine: Geo, venue, and KYC-based compliance policies
  • Security: Key isolation, mTLS support, and RBAC

πŸ“¦ Architecture Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ svc-gateway β”‚ β”‚ svc-strategy β”‚ β”‚ svc-executor β”‚ β”‚ (HTTP API) │◄──►│ (Signal Proc.) │◄──►│ (Trade Exec.) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β–² β–² β–² β”‚ β”‚ β”‚ β–Ό β–Ό β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ svc-risk β”‚ β”‚ svc-policy β”‚ β”‚ svc-storage β”‚ β”‚ (Risk Mgmt.) β”‚ β”‚ (Compliance) β”‚ β”‚ (Persistence) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β–² β–² β–² β”‚ β”‚ β”‚ β–Ό β–Ό β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ svc-cex β”‚ β”‚ svc-nft β”‚ β”‚ Message Bus β”‚ β”‚ (CEX Connect) β”‚ β”‚ (NFT Markets) β”‚ β”‚ (NATS/Kafka) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Core Components

Shared Libraries (sniper-*)

  • sniper-core: Core data structures and traits
  • sniper-amm: AMM implementations (CPMM, Stableswap, Uniswap V3)
  • sniper-cex: CEX REST/WebSocket clients
  • sniper-risk: Risk evaluation and honeypot detection
  • sniper-policy: Compliance and policy engines
  • sniper-storage: Database storage and distributed locks
  • sniper-telemetry: Monitoring, metrics, and alerting

Services (svc-*)

  • svc-gateway: HTTP API gateway and administration interface
  • svc-strategy: Signal processing and strategy execution
  • svc-executor: Trade execution across multiple venues
  • svc-risk: Risk management and compliance checking
  • svc-cex: CEX integration and order management
  • svc-nft: NFT marketplace integration
  • svc-policy: Policy enforcement and user context management

πŸš€ Getting Started

Prerequisites

  • Rust 1.80+
  • Docker (for containerized deployment)
  • Kubernetes (for production deployment)
  • Redis (for distributed locks)
  • PostgreSQL (for persistence)

Quick Start

`οΏ½ash

Clone the repository

git clone https://github.com/attakdefand/snipping-bot.git cd sniper-rs

Build all services

cargo build --release

Run tests

cargo test

Start services with Docker Compose

docker-compose up -d `

Configuration

Configuration is handled through TOML files in the configs/ directory:

  • config.base.toml: Base configuration
  • config.local.toml: Local development overrides
  • config.prod.toml: Production configuration

πŸ§ͺ Testing

The project includes comprehensive tests: `οΏ½ash

Run unit tests

cargo test

Run integration tests

cargo test --test integration_test

Run specific crate tests

cargo test -p sniper-storage `

πŸ“ˆ Performance Metrics

  • Signal Processing Latency: < 50ms
  • Trade Plan Generation: < 100ms
  • Risk Assessment: < 200ms
  • Execution Submission: < 150ms
  • CEX Integration Latency: < 100ms
  • Test Coverage: 95%

πŸ›‘οΈ Security

  • Private key access limited to svc-executor only
  • mTLS support for service mesh integration
  • JWT-based role-based access control
  • East-West communication restrictions

πŸ“š Documentation

🀝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details on how to contribute to this project.

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a pull request

πŸ“ž Support

For support, please open an issue on GitHub or contact the maintainers.

🌟 Star History

Star History Chart

πŸ“„ License

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

About

Sniper-RS is a high-frequency trading bot framework built with Rust for maximum performance and safety. It features a microservices-based architecture with shared libraries for modularity and scalability across DEXs, NFT markets, and CEXs.

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages