Enum FuturesApi

Source
pub enum FuturesApi {
Show 66 variants TestConnectivity, CheckServerTime, ExchangeInformation, OrderBook, RecentTrades, HistoricalTrades, AggregatedTrades, KLines, ContinuousKLines, IndexPriceKLines, MarkPriceKLines, MarkPrice, FundingRate, Ticker24hr, Ticker24hrAll, PriceTicker, PriceTickerAll, OrderBookTicker, OrderBookTickerAll, OpenInterest, OpenInterestStatistics, TopLongShortAccountRatio, TopLongShortPositionRatio, GlobalLongShortAccountRatio, TakerBuySellVolume, HistoricalLvtKLines, CompositeIndexSymbolInfo, MultiAssetsIndex, MultiAssetsIndexAll, GetPositionMode, ChangePositionMode, GetMultiAssetsMode, ChangeMultiAssetsMode, NewOrder, GetOrder, GetOpenOrder, CancelOrder, NewOrders, CancelOrders, GetOpenOrders, GetOpenOrdersAllSymbols, CancelOpenOrders, AutoCancelOpenOrders, GetAllOrders, AccountBalance, AccountInformation, ChangeInitialLeverage, ChangeMarginType, ModifyIsolatedPositionMargin, GetPositionMarginHistory, PositionInformation, AccountTrades, GetIncomeHistory, GetNotionalLeverageBrackets, PositionAdlQuantileEstimation, GetForceOrders, GetForceOrdersAll, QuantitativeRulesIndicators, QuantitativeRulesIndicatorsAll, GetCommissionRate, GetDownloadIdTransactionHistory, GetTransactionHistoryById, StartUserDataStream, KeepAliveUserDataStream, CloseUserDataStream, GetPortfolioMargin,
}
Expand description

Set of possible HTTP methods. Every variant corresponds to a single API call (combination of path and HTTP verb).

Variants§

§

TestConnectivity

Test connectivity to the Rest API.

§

CheckServerTime

Test connectivity to the Rest API and get the current server time.

§

ExchangeInformation

Current exchange trading rules and symbol information.

§

OrderBook

Get the order book.

§

RecentTrades

Get recent market trades.

Market trades means trades filled in the order book. Only market trades will be returned, which means the insurance fund trades and ADL trades won’t be returned.

§

HistoricalTrades

Get older market historical trades.

Market trades means trades filled in the order book. Only market trades will be returned, which means the insurance fund trades and ADL trades won’t be returned.

§

AggregatedTrades

Get compressed, aggregate market trades. Market trades that fill in 100ms with the same price and the same taking side will have the quantity aggregated.

  • If both startTime and endTime are sent, time between startTime and endTime must be less than 1 hour.
  • If fromId, startTime, and endTime are not sent, the most recent aggregate trades will be returned.
  • Only market trades will be aggregated and returned, which means the insurance fund trades and ADL trades won’t be aggregated.
§

KLines

Kline/candlestick bars for a symbol. Klines are uniquely identified by their open time.

  • If startTime and endTime are not sent, the most recent klines are returned.
§

ContinuousKLines

Kline/candlestick bars for a specific contract type. Klines are uniquely identified by their open time.

  • If startTime and endTime are not sent, the most recent klines are returned.

Contract type is one of the following:

  • PERPETUAL
  • CURRENT_QUARTER
  • NEXT_QUARTER
§

IndexPriceKLines

Kline/candlestick bars for the index price of a pair. Klines are uniquely identified by their open time.

  • If startTime and endTime are not sent, the most recent klines are returned.
§

MarkPriceKLines

Kline/candlestick bars for the mark price of a symbol. Klines are uniquely identified by their open time.

  • If startTime and endTime are not sent, the most recent klines are returned.
§

MarkPrice

Get Mark Price and Funding Rate.

§

FundingRate

Get Funding Rate History.

  • If startTime and endTime are not sent, the most recent data is returned.
  • If the number of data between startTime and endTime is larger than limit, return as startTime + limit.
  • In ascending order.
§

Ticker24hr

24 hour rolling window price change statistics for a single symbol.

§

Ticker24hrAll

24 hour rolling window price change statistics for all symbols.

§

PriceTicker

Latest price for a single symbol.

§

PriceTickerAll

Latest price for all symbols.

§

OrderBookTicker

Best price/qty on the order book for a single symbol.

§

OrderBookTickerAll

Best price/qty on the order book for all symbols.

§

OpenInterest

Get present open interest of a specific symbol.

§

OpenInterestStatistics

Get open interest history of a specific symbol.

  • If startTime and endTime are not sent, the most recent data is returned.
  • Only the data of the latest 30 days is available.
§

TopLongShortAccountRatio

Get top traders’ accounts Long/Short ratio.

  • If startTime and endTime are not sent, the most recent data is returned.
  • Only the data of the latest 30 days is available.
§

TopLongShortPositionRatio

Get top traders’ positions Long/Short ratio.

  • If startTime and endTime are not sent, the most recent data is returned.
  • Only the data of the latest 30 days is available.
§

GlobalLongShortAccountRatio

Get all traders’ accounts Long/Short ratio.

  • If startTime and endTime are not sent, the most recent data is returned.
  • Only the data of the latest 30 days is available.
§

TakerBuySellVolume

Taker Buy/Sell Volume ratio.

  • If startTime and endTime are not sent, the most recent data is returned.
  • Only the data of the latest 30 days is available.
§

HistoricalLvtKLines

Historical BLVT NAV Kline/Candlestick.

The BLVT NAV system is based on Binance Futures.

§

CompositeIndexSymbolInfo

Composite Index Symbol Information.

  • Only for composite index symbols.
§

MultiAssetsIndex

Asset index for Multi-Assets mode for a single symbol.

§

MultiAssetsIndexAll

Asset index for Multi-Assets mode for all symbols.

§

GetPositionMode

Get user’s position mode (Hedge Mode or One-way Mode) on every symbol.

§

ChangePositionMode

Change user’s position mode (Hedge Mode or One-way Mode) on every symbol.

§

GetMultiAssetsMode

Get user’s Multi-Assets mode (Multi-Assets Mode or Single-Asset Mode) on every symbol.

§

ChangeMultiAssetsMode

Change user’s Multi-Assets mode (Multi-Assets Mode or Single-Asset Mode) on every symbol.

§

NewOrder

Send in a new order.

See detailed documentation at https://binance-docs.github.io/apidocs/futures/en/#new-order-trade

§

GetOrder

Check an order’s status.

  • These orders will not be found:

    • order status is CANCELED or EXPIRED, AND
    • order has NO filled trade, AND
    • created time + 7 days < current time
  • Either orderId or origClientOrderId must be sent.

§

GetOpenOrder

Query currently opened order.

  • Either orderId or origClientOrderId must be sent.
  • If the queried order has been filled or cancelled, the error message “Order does not exist” will be returned.
§

CancelOrder

Cancel an active order.

  • Either orderId or origClientOrderId must be sent.
§

NewOrders

Place multiple orders.

  • Maximum number of orders is 5.
  • The orders are passed as JSON list in the same format as in NewOrder.
§

CancelOrders

Cancel multiple orders.

  • Maximum number of orders is 10.
  • Either orderIdList or origClientOrderIdList must be sent.
§

GetOpenOrders

Get all open orders on a single symbol.

§

GetOpenOrdersAllSymbols

Get all open orders for all symbols. Careful when accessing this as it has too much weight.

§

CancelOpenOrders

Cancels all active orders on a symbol.

§

AutoCancelOpenOrders

Cancel all open orders of the specified symbol at the end of the specified countdown.

  • The endpoint should be called repeatedly as heartbeats so that the existing countdown time can be canceled and replaced by a new one.
  • The system will check all countdowns approximately every 10 milliseconds, so please note that sufficient redundancy should be considered when using this function. We do not recommend setting the countdown time to be too precise or too small.
§Example usage:
  • Call this endpoint at 30s intervals with countdownTime of 120_000 (120s).
  • If this endpoint is not called within 120 seconds, all your orders of the specified symbol will be automatically canceled.
  • If this endpoint is called with countdownTime of 0, the countdown timer will be stopped.
§

GetAllOrders

Get all account orders; active, canceled, or filled.

  • These orders will not be found:
    • order status is CANCELED or EXPIRED, AND
    • order has NO filled trade, AND
    • created time + 7 days < current time
  • If orderId is set, it will get orders >= that orderId. Otherwise most recent orders are returned.
  • The query time period must be less then 7 days (default is the recent 7 days).
§

AccountBalance

Get account balance.

§

AccountInformation

Get current account information. User in single-asset/multi-assets mode will see different value, see comments in response section for detail.

§

ChangeInitialLeverage

Change user’s initial leverage of specific symbol market.

§

ChangeMarginType

Change margin type for a specific symbol market.

§

ModifyIsolatedPositionMargin

Modify isolated position margin for a specific symbol market.

  • Only for isolated symbol.
§

GetPositionMarginHistory

Get position margin change history.

§

PositionInformation

Get current position information.

Note: Please use with user data stream ACCOUNT_UPDATE to meet your timeliness and accuracy needs.

§

AccountTrades

Get trades for a specific account and symbol.

  • If startTime and endTime are both not sent, then the last 7 days’ data will be returned.
  • The time between startTime and endTime cannot be longer than 7 days.
  • The parameter fromId cannot be sent with startTime or endTime.
§

GetIncomeHistory

Get income history.

  • If neither startTime nor endTime is sent, then the recent 7 days’ data will be returned.
  • If incomeType is not sent, all kinds of flow will be returned.
  • trandId is unique in the same incomeType for a user.
  • Income history only contains data for the last three months.
§

GetNotionalLeverageBrackets

Get notional and leverage brackets.

§

PositionAdlQuantileEstimation

Get positions’ ADL quantile estimation.

  • Values update every 30s.
  • Values 0, 1, 2, 3, 4 shows the queue position and possibility of ADL from low to high.
  • For positions of the symbol are in One-way Mode or isolated margined in Hedge Mode, “LONG”, “SHORT”, and “BOTH” will be returned to show the positions’ ADL quantiles of different position sides.
  • If the positions of the symbol are crossed margined in Hedge Mode:
    • “HEDGE” as a sign will be returned instead of “BOTH”;
    • A same value calculated on unrealized PnL-s on Long and Short sides’ positions will be shown for “LONG” and “SHORT” when there are positions in both of Long and Short sides.
§

GetForceOrders

Get user’s force orders for a single symbol.

  • If autoCloseType is not sent, orders with both of the types will be returned.
  • If startTime is not sent, data within 7 days before endTime can be queried.
§

GetForceOrdersAll

Get user’s force orders for all symbols.

  • If autoCloseType is not sent, orders with both of the types will be returned.
  • If startTime is not sent, data within 7 days before endTime can be queried.
§

QuantitativeRulesIndicators

Get quantitative rules indicators for a single symbol.

For more information on this, please refer to the Futures Trading Quantitative Rules.

§

QuantitativeRulesIndicatorsAll

Get quantitative rules indicators for all symbols.

For more information on this, please refer to the Futures Trading Quantitative Rules.

§

GetCommissionRate

Get user’s commission rate.

§

GetDownloadIdTransactionHistory

Get download ID for futures transaction history.

Request limitation is 5 times per month, shared by front end download page and Rest API.

§

GetTransactionHistoryById

Get futures transaction history download link by ID received by GetDownloadIdTransactionHistory.

Download link expiration: 24h.

§

StartUserDataStream

Start a new user data stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has an active listenKey, that listenKey will be returned and its validity will be extended for 60 minutes.

§

KeepAliveUserDataStream

Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It’s recommended to send a ping about every 30 minutes.

§

CloseUserDataStream

Close out a user data stream.

§

GetPortfolioMargin

Get current portfolio margin exchange trading rules.

For more information on this, please refer to the FAQ.

Trait Implementations§

Source§

impl Clone for Api

Source§

fn clone(&self) -> Api

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
Source§

impl Debug for Api

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Api

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Endpoint for Api

Source§

fn as_endpoint(&self) -> String

The HTTP path for the given request.
Source§

fn http_verb(&self) -> HttpVerb

HTTP method (verb) used to access the endpoint. The most common are: Read more
Source§

fn ip_weight(&self) -> Option<u16>

The API weight regarding IP limits for the given request. Read more
Source§

fn order_weight(&self) -> Option<u16>

The API weight regarding UID (account) limits for the given request. Read more
Source§

fn security_type(&self) -> SecurityType

Determines access to the endpoint.
Source§

impl Copy for Api

Auto Trait Implementations§

§

impl Freeze for Api

§

impl RefUnwindSafe for Api

§

impl Send for Api

§

impl Sync for Api

§

impl Unpin for Api

§

impl UnwindSafe for Api

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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

Source§

type Output = T

Should always be Self
Source§

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

Source§

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

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>,

Source§

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.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T