Skip to content
NiqnilPublic

About

Open-source Rust framework for building event-driven live-trading & backtesting systems

Topics

Resources

Contributing

Security policy

Stars

6 stars

Watchers

1 watching

Forks

Repository files navigation

rustrade

A Rust ecosystem for building high-performance algorithmic trading systems.

MIT licensed Crates.io docs.rs Alpaca Integration Alpaca Weekly

Overview

rustrade is a collection of Rust libraries for live-trading, paper-trading, and backtesting. It provides:

  • Fast: Native Rust with minimal allocations. Data-oriented state management with O(1) lookups.
  • Robust: Strongly typed, thread-safe, with extensive test coverage.
  • Customisable: Plug-and-play Strategy and RiskManager components.
  • Scalable: Multithreaded architecture leveraging Tokio for async I/O.

Crates

Crate Description
rustrade Algorithmic trading engine with state management
rustrade-data Stream public market data from exchanges
rustrade-execution Stream account data and execute orders
rustrade-instrument Exchange, instrument, and asset data structures
rustrade-integration Low-level REST/WebSocket integration framework

Supported Exchanges

Exchange Market Data Execution Notes
Binance ✅ Spot, USD-M Futures ✅ Spot, Margin (cross/isolated) WebSocket + REST
Alpaca ✅ Equities (IEX/SIP), Crypto, Options ✅ Equities, Options, Crypto WebSocket + REST
Hyperliquid ✅ Perps, Spot ✅ Perps, Spot WebSocket + REST
Interactive Brokers ✅ Equities, Futures, Options ✅ Equities, Futures, Options, Forex TWS/Gateway API
Bitfinex ✅ Spot ❌ WebSocket
BitMEX ✅ Perpetual ❌ WebSocket
Bybit ✅ Spot, Perpetual ❌ WebSocket
Coinbase ✅ Spot ❌ WebSocket
Gate.io ✅ Spot, Futures, Perpetual, Options ❌ WebSocket
Kraken ✅ Spot ❌ WebSocket
OKX ✅ Spot, Futures, Perpetual, Options ❌ WebSocket

An exchange with no execution client is market-data only. See rustrade-data for the exact connector types and subscription kinds each one serves, and rustrade-execution for the order types each execution client accepts.

Data Providers

Provider Asset Classes Notes
Massive Stocks, Crypto, Forex, Options, Futures Historical + live streaming (Futures historical only)
Databento Equities, Futures, Options Nanosecond precision, DBN format
London Strategic Edge FX, Crypto, Equities/ETFs, Options, Futures proxies, CFDs Live ticks, historical candles, bulk export. ⚠️ Data is not redistributable

⚠️ London Strategic Edge data is NOT redistributable. This integration's code is MIT like the rest of the repository; the data it retrieves is not. LSE permits use for your own research, trading and model training — including commercially — but prohibits redistributing, reselling, or otherwise making the data available to third parties, in bulk or through any competing feed, download service or interface. Do not commit retrieved data, publish it as fixtures or example datasets, or re-serve it. Terms: https://londonstrategicedge.com/terms

Quick Start

Add to your Cargo.toml:

[dependencies]
rustrade = "0.16"
rustrade-data = { version = "0.16", features = ["hyperliquid"] }
rustrade-execution = { version = "0.16", features = ["binance"] }

See the examples for complete working code.

Minimum Supported Rust Version

Rust 1.95 or later.

Disclaimer

This software is for educational purposes only. USE THE SOFTWARE AT YOUR OWN RISK. THE AUTHORS AND ALL AFFILIATES ASSUME NO RESPONSIBILITY FOR YOUR TRADING RESULTS.

Fork Attribution

This project is a fork of barter-rs, originally developed by Just A Stream, Inc. and the Barter Ecosystem Contributors. See NOTICE for full attribution.

Fork history:

Getting Help

Check the API Documentation. If your question isn't answered there, open a Discussion on GitHub.

Contributing

Contributions welcome! Please open a PR targeting the develop branch. See CONTRIBUTING.md.

License

MIT License. See LICENSE.

About

Open-source Rust framework for building event-driven live-trading & backtesting systems

Topics

Resources

Contributing

Security policy

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages