unkuseni / rs_smm

0 stars 0 forks source link

Rust Simple Market Maker (RS_SMM)

Overview

RS_SMM is a sophisticated market making bot implemented in Rust. It's designed to provide liquidity and profit from the bid-ask spread in cryptocurrency markets. The system supports multiple exchanges, employs advanced order book analysis, and uses dynamic quote generation based on market conditions.

Table of Contents

  1. Prerequisites
  2. Installation
  3. Configuration
  4. Running the Bot
  5. Project Structure
  6. Making Changes
  7. Key Components
  8. Contributing
  9. Disclaimer

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/your-repo/rs_smm.git
    cd rs_smm
  2. Build the project:

    cargo build --release

Configuration

  1. Create a config.toml file in the project root directory.

  2. Add your configuration settings. Here's a template:

    exchange = "bybit"  # or "binance"
    symbols = ["BTCUSDT", "ETHUSDT"]
    leverage = 10
    orders_per_side = 5
    final_order_distance = 0.01
    depths = [5, 50]
    rate_limit = 100
    tick_window = 6000 // 1 mins
    bps = [0.01, 0.02]  # Basis points for spread
    
    [[api_keys]]
    key = "your_api_key"
    secret = "your_api_secret"
    symbol = "BTCUSDT"
    
    [[balances]]
    symbol = "BTCUSDT"
    amount = 1000.0
  3. Adjust the values according to your trading strategy and risk tolerance.

Running the Bot

  1. Ensure your config.toml is properly set up.
  2. Run the bot:
    cargo run --release
  3. The bot will start, connect to the specified exchange(s), and begin market making based on your configuration.

Project Structure

Making Changes

  1. Modifying the Strategy:

    • Edit src/strategy/market_maker.rs to adjust the core market making logic.
    • Modify src/trader/quote_gen.rs to change how orders are generated.
  2. Adjusting Parameters:

    • Edit src/parameters/parameters.rs to add or modify configurable parameters.
    • Update config.toml to reflect any new parameters.
  3. Adding New Features:

    • Add new files in the relevant directories (e.g., src/features/ for new market analysis tools).
    • Integrate new features in src/strategy/market_maker.rs or src/trader/quote_gen.rs as appropriate.
  4. Supporting New Exchanges:

    • Extend the OrderManagement enum in src/trader/quote_gen.rs.
    • Implement necessary API calls for the new exchange.
  5. Improving Performance:

    • Profile the application to identify bottlenecks.
    • Consider optimizing critical paths, especially in order generation and market data processing.

Key Components

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a new branch for your feature
  3. Implement your changes
  4. Write or update tests as necessary
  5. Submit a pull request with a clear description of your changes

Disclaimer

This software is for educational and research purposes only. Use it at your own risk. Cryptocurrency trading carries a high level of risk and may not be suitable for all investors. Always thoroughly test any trading bot in a safe, simulated environment before deploying with real funds.