pub struct FuturesMarket {
    pub client: Client,
    pub recv_window: u64,
}

Fields§

§client: Client§recv_window: u64

Implementations§

source§

impl FuturesMarket

source

pub async fn get_depth<S>(&self, symbol: S) -> Result<OrderBook>
where S: Into<String>,

Order book (Default 100; max 1000)

source

pub async fn get_trades<S>(&self, symbol: S) -> Result<Trades>
where S: Into<String>,

Get trades for a pair

source

pub async fn get_historical_trades<S1, S2, S3>( &self, symbol: S1, from_id: S2, limit: S3 ) -> Result<Trades>
where S1: Into<String>, S2: Into<Option<u64>>, S3: Into<u16>,

Get historical trades

source

pub async fn get_agg_trades<S1, S2, S3, S4, S5>( &self, symbol: S1, from_id: S2, start_time: S3, end_time: S4, limit: S5 ) -> Result<AggTrades>
where S1: Into<String>, S2: Into<Option<u64>>, S3: Into<Option<u64>>, S4: Into<Option<u64>>, S5: Into<u16>,

Get aggregated trades

source

pub async fn get_funding_rate<S1, S3, S4, S5>( &self, symbol: S1, start_time: S3, end_time: S4, limit: S5 ) -> Result<Vec<FundingRate>>
where S1: Into<String>, S3: Into<Option<u64>>, S4: Into<Option<u64>>, S5: Into<u16>,

Get funding rate history

source

pub async fn get_open_interest_history<S1, S2, S3, S4, S5>( &self, symbol: S1, period: S2, start_time: S3, end_time: S4, limit: S5 ) -> Result<Vec<OpenInterestHistory>>
where S1: Into<String>, S2: Into<String>, S3: Into<Option<u64>>, S4: Into<Option<u64>>, S5: Into<u16>,

Get open interest history

source

pub async fn get_trader_account_long_short_ratio<S1, S2, S3, S4, S5>( &self, symbol: S1, period: S2, start_time: S3, end_time: S4, limit: S5 ) -> Result<Vec<LongShortRatio>>
where S1: Into<String>, S2: Into<String>, S3: Into<Option<u64>>, S4: Into<Option<u64>>, S5: Into<u16>,

Get Top Trader Account Long/Short Ratio

source

pub async fn get_trader_position_long_short_ratio<S1, S2, S3, S4, S5>( &self, symbol: S1, period: S2, start_time: S3, end_time: S4, limit: S5 ) -> Result<Vec<LongShortRatio>>
where S1: Into<String>, S2: Into<String>, S3: Into<Option<u64>>, S4: Into<Option<u64>>, S5: Into<u16>,

Get Top Trader Position Long/Short Ratio

source

pub async fn get_long_short_ratio<S1, S2, S3, S4, S5>( &self, symbol: S1, period: S2, start_time: S3, end_time: S4, limit: S5 ) -> Result<Vec<LongShortRatio>>
where S1: Into<String>, S2: Into<String>, S3: Into<Option<u64>>, S4: Into<Option<u64>>, S5: Into<u16>,

Get Long/Short Ratio

source

pub async fn get_taker_long_short_ratio<S1, S2, S3, S4, S5>( &self, symbol: S1, period: S2, start_time: S3, end_time: S4, limit: S5 ) -> Result<Vec<LongShortRatio>>
where S1: Into<String>, S2: Into<String>, S3: Into<Option<u64>>, S4: Into<Option<u64>>, S5: Into<u16>,

Get Taker Long/Short Ratio

source

pub async fn get_klines<S1, S2, S3, S4, S5>( &self, symbol: S1, interval: S2, limit: S3, start_time: S4, end_time: S5 ) -> Result<KlineSummaries>
where S1: Into<String>, S2: Into<String>, S3: Into<u16>, S4: Into<Option<u64>>, S5: Into<Option<u64>>,

Returns up to ‘limit’ klines for given symbol and interval (“1m”, “5m”, …) https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#klinecandlestick-data

source

pub async fn get_blvt_klines_v<S1, S2, S3, S4, S5>( &self, symbol: S1, interval: S2, limit: S3, start_time: S4, end_time: S5 ) -> Result<Vec<Vec<Value>>>
where S1: Into<String>, S2: Into<String>, S3: Into<u16>, S4: Into<Option<u64>>, S5: Into<Option<u64>>,

Returns up to ‘limit’ blvt klines for given symbol and interval (“1m”, “5m”, …) Note that the symbol is not the traditional pair but rather {symbol}{UP|DOWN} https://binance-docs.github.io/apidocs/futures/en/#blvt-nav-kline-candlestick-streams As the vector fields are undocumented on binance futures you are un your own, follow KlineSummary for an example

source

pub async fn get_mark_price_klines_v<S1, S2, S3, S4, S5>( &self, symbol: S1, interval: S2, limit: S3, start_time: S4, end_time: S5 ) -> Result<Vec<Vec<Value>>>
where S1: Into<String>, S2: Into<String>, S3: Into<u16>, S4: Into<Option<u64>>, S5: Into<Option<u64>>,

Returns up to ‘limit’ mark price klines for given symbol and interval (“1m”, “5m”, …) https://binance-docs.github.io/apidocs/futures/en/#mark-price-kline-candlestick-data As the vector fields are undocumented on binance futures you are un your own, follow KlineSummary for an example

source

pub async fn get_index_price_klines_v<S1, S2, S3, S4, S5>( &self, symbol: S1, interval: S2, limit: S3, start_time: S4, end_time: S5 ) -> Result<Vec<Vec<Value>>>
where S1: Into<String>, S2: Into<String>, S3: Into<u16>, S4: Into<Option<u64>>, S5: Into<Option<u64>>,

Returns up to ‘limit’ index price klines for given symbol and interval (“1m”, “5m”, …) https://binance-docs.github.io/apidocs/futures/en/#index-price-kline-candlestick-data As the vector fields are undocumented on binance futures you are un your own, follow KlineSummary for an example

source

pub async fn get_continuous_contract_klines_v<S1, S2, S3, S4, S5>( &self, symbol: S1, interval: S2, limit: S3, start_time: S4, end_time: S5 ) -> Result<Vec<Vec<Value>>>
where S1: Into<String>, S2: Into<String>, S3: Into<u16>, S4: Into<Option<u64>>, S5: Into<Option<u64>>,

Returns up to ‘limit’ continuous contract klines for given symbol and interval (“1m”, “5m”, …) https://binance-docs.github.io/apidocs/futures/en/#continuous-contract-kline-candlestick-data As the vector fields are undocumented on binance futures you are un your own, follow KlineSummary for an example

source

pub async fn get_notional_leverage_brackets<S>( &self, symbol: S ) -> Result<Vec<SymbolBrackets>>
where S: Into<String>,

https://binance-docs.github.io/apidocs/futures/en/#notional-and-leverage-brackets-user_data

source

pub async fn get_index_info<S>(&self, symbol: Option<S>) -> Result<PriceStats>
where S: Into<String>,

https://binance-docs.github.io/apidocs/futures/en/#composite-index-symbol-information Only for composite symbols (ex: DEFIUSDT)

source

pub async fn get_24h_price_stats<S>(&self, symbol: S) -> Result<PriceStats>
where S: Into<String>,

24hr ticker price change statistics

source

pub async fn get_all_24h_price_stats(&self) -> Result<Vec<PriceStats>>

24hr ticker price change statistics for all symbols

source

pub async fn get_price<S>(&self, symbol: S) -> Result<SymbolPrice>
where S: Into<String>,

Latest price for ONE symbol.

source

pub async fn get_all_book_tickers(&self) -> Result<BookTickers>

Symbols order book ticker -> Best price/qty on the order book for ALL symbols.

source

pub async fn get_book_ticker<S>(&self, symbol: S) -> Result<Tickers>
where S: Into<String>,

source

pub async fn get_mark_prices( &self, symbol: Option<String> ) -> Result<Vec<MarkPrice>>

source

pub async fn get_all_liquidation_orders(&self) -> Result<LiquidationOrders>

source

pub async fn open_interest<S>(&self, symbol: S) -> Result<OpenInterest>
where S: Into<String>,

Trait Implementations§

source§

impl Binance for FuturesMarket

source§

fn new_with_config( api_key: Option<String>, secret_key: Option<String>, config: &Config ) -> Self

source§

fn new(api_key: Option<String>, secret_key: Option<String>) -> Self

source§

fn new_with_env(config: &Config) -> Self

Create a binance API using environment variables for credentials BINANCE_API_KEY=$YOUR_API_KEY BINANCE_API_SECRET_KEY=$YOUR_SECRET_KEY
source§

impl Clone for FuturesMarket

source§

fn clone(&self) -> FuturesMarket

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more