revolutx
Unofficial Rust SDK for the Revolut X crypto exchange REST API.
NOTE: This project is in active development stage - public API will likely change in next versions
revolutx is a custom implementation of Revolut X API. It is not generated from OpenAPI,
but designed from scratch to provide clean, 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.5"
= { = "1", = ["macros", "rt-multi-thread"] }
Cargo features
| Feature | Default | What it enables |
|---|---|---|
rest |
✅ | The REST API: Ed25519-signed HTTP client and all endpoint groups (pulls reqwest + Ed25519). |
fix |
— | FIX 4.4 client (market data + trading). Reserved, not yet implemented. |
keystore |
— | Encrypted credential vault exposed as a Signer, stored in rcypher's multi-factor SecretStore format (Argon2id + AES-256-CBC + HMAC; password and/or FIDO2; manageable with the rcypher CLI). Implies rest. |
agent |
— | Signing-agent proxy (unix-only): a serve() daemon plus an AgentExecutor client, so a headless process can delegate signing + HTTP to an agent that holds the keystore. Implies rest. |
commands |
— | High-level command layer: a parse-neutral Command model, one execute dispatcher, a structured CommandOutput, and a Presenter seam (with a shared JsonPresenter), so a surface differs only in input parsing and output presentation. Adds no dependencies. Implies rest. |
The domain models and error types are always available, independent of features. A FIX-only consumer (e.g. a market maker) can drop the HTTP/TLS dependency tree entirely:
= { = "0.5", = false, = ["fix"] }
Generating an API key
Create an Ed25519 key pair and register the public key in the Revolut X web app. Generate one from the SDK:
let pair = generate_key_pair?;
println!; // register this public key in the web app
// Keep pair.private_pem secret — e.g. store it in the encrypted vault (the CLI).
# Ok::
…or with openssl:
Keep the private key secret. The SDK loads it via
[ClientBuilder::private_key_pem], or — encrypted at rest — from the vault
managed by revolutx-cli.
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, place_raw, replace, get, active, historical, historical_range, cancel, cancel_all, fills |
client.trades() |
all, private, private_range |
The *_range variants fetch an arbitrary date range: the exchange answers at
most 30 days per query (and defaults a missing end to start + 7 days), so they
walk the range in windows, follow every pagination cursor, and merge the result
newest-first — with bounded retries on rate limits.
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.
Related crates
revolutx-cli— a command-line interface over this SDK: an encrypted credential vault (rcypherSecretStore; password and/or FIDO2), every endpoint as a command, and a signing agent that holds the keystore so headless clients can delegate signing (cargo install revolutx-cli).revolutx-mcp— a Model Context Protocol (MCP) server that exposes this SDK to LLM clients such as Claude Desktop, talking to the agent over a one-time-token-authenticated socket (cargo install revolutx-mcp).
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.88 (edition 2024). The keystore and agent features pull in
rcypher, which requires 1.87; the workspace's own floor is 1.88 (the
time dependency).
License
Licensed under the Apache License 2.0.