revolutx
Unofficial Rust SDK for the Revolut X crypto exchange REST API.
revolutx is a handwritten, domain-oriented SDK aimed at trading bots and
automation. It models trading concepts — symbols, sides, orders, fills,
balances, order books, candles, tickers — as Rust types, signs requests
automatically with Ed25519, and never represents money or quantities as f64
(all decimals use [rust_decimal]).
Not affiliated with Revolut. Trading automation carries financial risk. You are responsible for your own validation, risk controls, and credential security. This crate handles API access, typing, signing, and error reporting only — it does not provide trading strategy or risk management.
Features
- Domain-oriented, handwritten API — not a generated OpenAPI client.
- Automatic Ed25519 request signing (
X-Revx-API-Key/X-Revx-Timestamp/X-Revx-Signature); callers never build these headers. - Decimal-safe values everywhere via
rust_decimal::Decimal(re-exported asrevolutx::Decimal). - Full endpoint coverage: balances, configuration, market data, orders, and trades — verified against the OpenAPI spec by a drift test.
- Safe order builders that prevent obviously invalid requests.
- Typed errors that distinguish configuration, auth, rate-limit, and API errors.
- Async (
reqwest+rustls), with optional unauthenticated access to the public market-data endpoints.
Installation
[]
= "0.1"
= { = "1", = ["macros", "rt-multi-thread"] }
Generating an API key
Create an Ed25519 key pair and register the public key in the Revolut X web app:
Keep private.pem secret. The SDK loads it via
[ClientBuilder::private_key_pem].
Quick start
use ;
async
Public market data (no credentials)
# async
Placing orders
Order builders validate the request (positive price/size, non-empty symbol, exactly one configuration and size) and sign it for you:
use ;
use FromStr;
# async
Error handling and rate limits
# async
Endpoint groups
| Group | Methods |
|---|---|
client.balances() |
get_all |
client.configuration() |
currencies, pairs |
client.market_data() |
order_book, order_book_with_limit, public_order_book, candles, tickers, tickers_for, last_trades |
client.orders() |
limit_buy/limit_sell(_quote), market_buy/market_sell(_quote), place, replace, get, active, historical, cancel, cancel_all, fills |
client.trades() |
all, private |
See docs/openapi-inventory.md for the full
operation/schema mapping.
Examples
Runnable examples live in examples/:
REVOLUTX_API_KEY=...
examples/place_limit_order.rs performs real trading and is guarded by
REVOLUTX_CONFIRM_PLACE_ORDER=yes.
Testing
The default test suite is fast, deterministic, and offline:
Opt-in, read-only live smoke tests require credentials and are ignored by default:
MSRV
Rust 1.85 (edition 2024).
License
Licensed under the Apache License 2.0.