# mmflow — Rust SDK
A blocking REST client (OHLCV candles) and a WebSocket client for the mmflow
market-data API.
```toml
[dependencies]
mmflow = "0.1"
```
## REST
```rust
let client = mmflow::Client::new(""); // "" → https://mmflow.ai
let candles = client.candles("BTC", "1m", 24)?;
for c in &candles {
println!("{} {}", c.time, c.close);
}
```
## WebSocket
`auth`, exponential-backoff reconnect, and subscription replay are built in.
```rust
use mmflow::{Socket, SocketOptions};
let mut sock = Socket::new(SocketOptions {
api_key: Some("YOUR_KEY".into()),
..Default::default()
});
sock.subscribe("trades", "BTC");
})?; // blocks; reconnects unless auto_reconnect is false
```
Channels: `trades`, `orderbook`, `candles`, `liquidations`, `funding`,
`openInterest`, `markPrice`, `footprint`.