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.
- Prerequisites
- Installation
- Configuration
- Running the Bot
- Project Structure
- Making Changes
- Key Components
- Contributing
- Disclaimer
- Rust (latest stable version)
- Cargo
- Git
- An account with supported exchanges (currently Bybit and Binance)
- API keys for the exchanges you plan to use
-
Clone the repository:
git clone https://github.com/your-repo/rs_smm.git cd rs_smm
-
Build the project:
cargo build --release
-
Create a
config.toml
file in the project root directory. -
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
-
Adjust the values according to your trading strategy and risk tolerance.
- Ensure your
config.toml
is properly set up. - Run the bot:
cargo run --release
- The bot will start, connect to the specified exchange(s), and begin market making based on your configuration.
src/
features/
: Contains market microstructure analysis toolsparameters/
: Handles configuration and parameter managementstrategy/
: Implements the market making strategytrader/
: Manages order generation and executionmain.rs
: Entry point of the application
-
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.
- Edit
-
Adjusting Parameters:
- Edit
src/parameters/parameters.rs
to add or modify configurable parameters. - Update
config.toml
to reflect any new parameters.
- Edit
-
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
orsrc/trader/quote_gen.rs
as appropriate.
- Add new files in the relevant directories (e.g.,
-
Supporting New Exchanges:
- Extend the
OrderManagement
enum insrc/trader/quote_gen.rs
. - Implement necessary API calls for the new exchange.
- Extend the
-
Improving Performance:
- Profile the application to identify bottlenecks.
- Consider optimizing critical paths, especially in order generation and market data processing.
- MarketMaker: Main strategy implementation (
src/strategy/market_maker.rs
) - QuoteGenerator: Responsible for order generation (
src/trader/quote_gen.rs
) - Engine: Calculates market microstructure features (
src/features/engine.rs
) - Parameters: Manages configuration and runtime parameters (
src/parameters/parameters.rs
)
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a new branch for your feature
- Implement your changes
- Write or update tests as necessary
- Submit a pull request with a clear description of your changes
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.