Futures Exchange

The Futures Exchange object is similar to the Exchange object, except it is designed to work with exchanges or brokerages that trade perpetual futures. For example, Blankly supports both Binance and BinanceFutures objects, for SPOT markets and Perpetual Futures respectively.

Creation

Because this is designed to work with each exchange, the creation is different depending on usage & goal.

from blankly import futures

Binance

exchange = futures.BinanceFutures()

FTX

exchange = futures.FTXFutures()

Arguments

ArgDescriptionExamplesType
portfolio_nameOptionally fill this with a reference to a portfolio inside keys.json.'my cool portfolio'str
keys_pathOptionally fill this with a path to the keys.json file.'./keys.json'str
settings_pathOptionally fill this with a path to the settings.json file'./settings.json'str

Response

DescriptionExamplesType
An exchange objectscheduler = futures.BinanceFutures()FuturesExchange object.

Functions

get_name()

Get the name of the portfolio that the exchange object is using.

Response

DescriptionExamplesType
The name of the portfolio from keys.json'my_cool_portfolio'str

get_type()

Get the type of exchange that the interface is running on.

Response

DescriptionExamplesType
A string identifier for the exchange'binance_futures', 'ftx_futures'str

preferences

Get the preferences dictionary that the exchange class is using.

Response

DescriptionExamplesType
A dictionary with defined preferences.See here.str

get_interface()

Get the authenticated interface object (very important).

Response

DescriptionExamplesType
This gives the actual interface object to use. See here.All interfaces have identical callsFuturesExchangeInterface

calls

This is an important field that allows the user to get the direct, unfiltered API calls to the exchange. This function can be used to bypass the user interface & opens up all implemented calls which go far beyond the scope of the interface.

Response

DescriptionExamplesType
A direct calls object which bypasses all Blankly featuresAPIVarious API objects