A Rust port of the popular CCXT cryptocurrency exchange trading library.
- 100+ Exchanges - CEX (Binance, Bybit, OKX, ...) and DEX (Hyperliquid, dYdX, Paradex, ...)
- Unified API - Consistent interface across all exchanges
- REST & WebSocket - Full support for both protocols
- Async/Await - Built on Tokio for high-performance operations
- Type Safety - Strongly typed with Rust's type system
| Type | Exchanges |
|---|---|
| CEX | Binance, Bybit, OKX, Kraken, KuCoin, Coinbase, Gate.io, Bitget, MEXC, HTX, Upbit, Bithumb, +90 more |
| DEX | Hyperliquid, dYdX v4, Paradex, Apex, Defx, Derive, WavesExchange |
See docs/exchanges.md for the full list.
[dependencies]
ccxt-rust = "0.1"
tokio = { version = "1.0", features = ["full"] }| Feature | Default | Description |
|---|---|---|
cex |
✅ | Centralized exchanges |
dex |
❌ | Decentralized exchanges + crypto primitives |
full |
❌ | All features |
use ccxt_rust::exchanges::Binance;
use ccxt_rust::types::Exchange;
use ccxt_rust::ExchangeConfig;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let exchange = Binance::new(ExchangeConfig::default())?;
// Fetch ticker
let ticker = exchange.fetch_ticker("BTC/USDT").await?;
println!("BTC/USDT: {:?}", ticker.last);
// Fetch order book
let orderbook = exchange.fetch_order_book("BTC/USDT", Some(5)).await?;
println!("Best bid: {}, Best ask: {}",
orderbook.bids[0].price,
orderbook.asks[0].price
);
Ok(())
}See examples/ for more examples including WebSocket and trading.
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.