ccxt-rust
What it does
This skill is a guide for building crypto exchange features in Rust projects using the CCXT crates. It is for developers building trading bots or low-latency services in Rust.
When to use it
- ✓When you are building a Rust service that reads crypto market data.
- ✓When you need to place or check orders from a Rust trading bot.
- ✓When you want live WebSocket updates in a Rust project.
Skill link
https://github.com/ccxt/ccxt/blob/master/.claude/skills/ccxt-rust/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Write a Rust program that prints the Binance BTC/USDT ticker.”
5 new skills a week. 1 minute to read.
How it works
The AI adds the ccxt crate with tokio, creates a typed exchange object, and awaits each method, which returns a typed result or an error.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
CCXT for Rust
A comprehensive guide to using CCXT in Rust projects for cryptocurrency exchange integration.
Every exchange has a typed wrapper (ccxt::Binance, ccxt::Kraken, …) exposing the unified
CCXT API with native Rust return types — Ticker, Order, OrderBook, Market — instead of a
dynamic value. All methods are async and return Result<T, ExchangeError>.
Installation
REST API
cargo add ccxt tokio --features tokio/full
WebSocket API (ccxt.pro)
cargo add ccxt-pro
Prediction markets
cargo add ccxt-prediction
Cargo.toml
[dependencies]
ccxt = "4.5.75" # REST exchanges (typed) — required
ccxt-pro = "4.5.75" # WebSocket (watch*) exchanges — only if you stream
ccxt-prediction = "4.5.75" # prediction markets — only if you trade them
tokio = { version = "1", features = ["full"] }
Requirements
- Rust stable, edition 2021 or later.
- A tokio runtime — every unified method is
async. There is no sync API. ccxtalone is enough for REST. Addccxt-proonly when you needwatch_*; it is a separate crate so a REST-only build does not compile the whole WebSocket surface.
Quick Start
REST API
use ccxt::{Binance, Params};
#[tokio::main]
async fn main() -> Result<(), ccxt::ExchangeError> {
let mut exchange = Binance::new(None);
exchange.load_markets(false).await;
let ticker = exchange.fetch_ticker("BTC/USDT", Params::none()).await?;
println!("{} last={:?} bid={:?} ask={:?}", ticker.symbol, ticker.last, ticker.bid, ticker.ask);
Ok(())
}
WebSocket API — real-time updates
use ccxt::Params;
use ccxt_pro::Binance;
#[tokio::main]
async fn main() -> Result<(), ccxt::ExchangeError> {
let mut exchange = Binance::new(None);
exchange.try_load_markets(false).await?;
loop {
let ticker = exchange.watch_ticker("BTC/USDT", Params::none()).await?;
println!("{:?}", ticker.last); // live updates
}
}
Each watch_* call resolves to one decoded update, so consuming a stream is just calling it in
a loop.
Crate layout
| Crate | Contains | Use when |
|---|---|---|
ccxt |
Typed REST wrappers (ccxt::Binance, …), Params, Config, types::*, TypedExchange. Re-exports the whole engine at its root. |
Always |
ccxt-pro |
Typed WebSocket wrappers (ccxt_pro::Binance, …) with watch_* |
Streaming |
ccxt-prediction |
Typed prediction-market wrappers (ccxt_prediction::Kalshi, …) |
Prediction markets |
ccxt-base |
The untyped engine (Value, HTTP, crypto, rate limiter, Cores, WS infra) |
Rarely direct — ccxt re-exports it |
ccxt re-exports ccxt-base at its root, so ccxt::Value, ccxt::runtime::…,
ccxt::exchanges::binance::BinanceCore resolve alongside the typed ccxt::Binance.
Coverage today: 105 typed REST venues, 76 typed WebSocket venues, 7 prediction venues.
REST vs WebSocket
| Feature | REST API | WebSocket API |
|---|---|---|
| Use for | One-time queries, placing orders | Real-time monitoring, live price feeds |
| Crate | ccxt |
ccxt-pro |
| Import | use ccxt::Binance; |
use ccxt_pro::Binance; |
| Methods | fetch_* (fetch_ticker, fetch_order_book) |
watch_* (watch_ticker, watch_order_book) |
| Speed | Slower (HTTP request/response) | Faster (persistent connection) |
| Rate limits | Strict (1–2 req/sec) | More lenient (continuous stream) |
| Best for | Trading, account management | Price monitoring, arbitrage detection |
Both crates expose a type named Binance. When you use both in one file, alias one of them:
use ccxt::Binance as BinanceRest;
use ccxt_pro::Binance as BinanceWs;
Runtime setup
Two settings matter in real programs and are easy to miss:
fn main() {
// 1. The transpiled core signals errors by panicking across an internal
// catch_unwind; the typed layer turns that back into `Result`. Silencing
// the default hook stops caught panics from printing to stderr.
// Set CCXT_SHOW_PANICS=1 to see them while debugging.
if std::env::var("CCXT_SHOW_PANICS").is_err() {
std::panic::set_hook(Box::new(|_| {}));
}
// 2. The generated exchange code is deeply nested — give worker threads a
// large stack. The default 2 MB can overflow on some venues.
let rt = tokio::runtime::Builder::new_multi_th
FAQ
Does it have a synchronous API?
No. The skill says every unified method is async and there is no sync API.
Do I need the WebSocket crate?
Only if you stream live data. The skill says the ccxt-pro crate is separate and is needed for watch functions.
What runtime is required?
The skill requires a tokio runtime and a stable Rust version, edition 2021 or later.
Details
Original description by the author
CCXT cryptocurrency exchange library for Rust developers. Covers both REST API (standard) and WebSocket API (real-time). Helps install CCXT, connect to exchanges, fetch market data, place orders, stream live tickers/orderbooks, handle authentication, and manage errors in Rust projects. Use when working with crypto exchanges in Rust applications, trading bots, or low-latency services. Async (tokio), typed wrappers returning Result<T, ExchangeError>.
repo: ccxt/ccxt
Popularity
- GitHub stars
- 45k
- Ranking position
- #6386
- License
- MIT
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
binance-agentic-wallet
45kLets your agent manage a Binance Web3 wallet through the baw command line, including sign-in, balances, transfers, token swaps, and limit orders.
binance-sports-ai-analyzer
45kHelps your agent look up World Cup match predictions, AI analysis, and news insights, and recompute win odds after you adjust the signals.
binance-tokenized-securities-info
45kLets your agent look up Ondo tokenized US stocks on Binance Web3, covering token lists, company info, trading status, and on-chain prices.
binance
45kLets your agent use Binance Spot, USD-M Futures, and Convert through the binance-cli tool. Requires you to set up authentication first.
Similar skills
api-connector-builder
280kHas your agent build new API connections following the existing pattern. Use when you need to add one more integration without creating a new way of doing things.
api-design
280kHelps your agent design REST APIs following best practices. It's useful for defining how APIs communicate, how errors are shown, and how to organize data.
backend-patterns
280kHelps your agent with server-side architecture patterns and database optimization. It's useful for building or reviewing code that runs on the server.