Skip to main content

Crate oanda_rs

Crate oanda_rs 

Source
Expand description

§oanda-rs

An asynchronous Rust SDK for the OANDA v20 REST and streaming API, designed for multi-threaded tokio environments.

  • One shared clientClient is cheap to clone and Send + Sync; all clones share a connection pool and a built-in rate limiter that keeps you under OANDA’s per-IP limits (120 REST requests/s, 2 new connections/s).
  • Typed models — every request/response type derives Debug, Serialize and Deserialize, with decimals as rust_decimal::Decimal newtypes (never floats).
  • Streaming — pricing and transaction streams are self-managing: they detect stale connections via heartbeats, reconnect with capped exponential backoff, and back-fill missed transactions.

§Quickstart

use oanda_rs::{Client, Environment};

let client = Client::new(Environment::Practice, std::env::var("OANDA_TOKEN").unwrap());

This is an unofficial SDK; use the Practice environment until you are confident in your integration. See the repository’s docs/ directory for guides on streaming, rate limiting and testing.

Modules§

endpoints
Endpoint implementations, grouped by API domain.
models
Data models mirroring the OANDA v20 component schemas.
prelude
Convenience re-exports of the types needed by almost every integration.
streaming
Self-managing streaming connections for the pricing and transaction streams.

Structs§

ApiErrorBody
The JSON body OANDA returns for error responses.
Client
An asynchronous OANDA v20 API client.
ClientBuilder
Configures and builds a Client.

Enums§

Environment
The OANDA environment (host pair) a Client talks to.
Error
The unified error type returned by every SDK operation.