Skip to main content

Crate polyoxide_binance

Crate polyoxide_binance 

Source
Expand description

Rust client for Binance USDⓈ-M futures public market data (fapi.binance.com) and, with the ws feature, its market streams (fstream.binance.com).

No credentials are needed. Every request is charged against a WeightBudget, because Binance limits each IP by request weight, which varies by route and parameters, rather than by request count.

use polyoxide_binance::{usdm::types::Symbol, Usdm};

let usdm = Usdm::new()?;
let btc = Symbol::new("BTCUSDT")?;
let index = usdm.market().premium_index(&btc).send().await?;
println!("BTCUSDT mark {} funding {}", index.mark_price, index.last_funding_rate);

Re-exports§

pub use error::BinanceError;
pub use usdm::Usdm;
pub use usdm::UsdmBuilder;
pub use weight::WeightBudget;

Modules§

error
Error types for the Binance API.
usdm
Binance USDⓈ-M futures on fapi.binance.com.
weight
Binance’s request-weight budget, and the separate limit on the funding routes.