Jesse is now fully integrated with "FTX Futures"

Jesse is now fully integrated with "FTX Futures"

3 years agoNews By Saleh Mir

For those of you who have been tried of Binance lately, this is an interesting release bringing full support for the "FTX Futures" exchange to Jesse. It also brings backtesting support for Bybit.

I also did major refactoring in parts of my source code responsible for exchange drivers. This is good news because it means I can develop new drivers faster in the future.

FTX's API was missing few essential endpoints such as candle streams and even stop orders! Boy, don't let me get started on that! Anyways, to bypass these limitations, I had to implement workarounds and improve the connection failure mechanisms of Jesse. On the bright hand, these mechanisms will come in handy for other exchanges as well. I also improved our error handling in general.

My experience with FTX so far

I want to share with you my experience with FTX so far. There were few pros and few cons. Let's start with the good things:

Pros:

  • Variety of trading assets They offer a very good number of assets for trading with good liquidity.
  • Subaccounts: Unlike Binance, subaccounts are open by default for all FTX users. This is very important to us considering we need an isolated account for algo-trading with Jesse.
  • Tokenized Stocks: FTX offers tokenized Stocks. Right after we implement the spot support in the coming months, we can work on adding support for stocks trading with Jesse on FTX.

Cons:

  • Super strict KYC: They asked for way too many documents for verifying my account to level 2, just so I can develop this driver. That part wasn't fun or necessary at all!
  • Missing endpoints in their API: Their API doesn't offer a few of the most basic endpoints that I have seen on all other platforms. For example, there's no WebSocket stream for candles, so I had to generate them from the streamed trades instead. That wasn't fun to implement! And that's just the tip of the ice-burg. I could go on about this part, but I don't want to bore you.
  • Bad support: Based on my personal interactions so far with both FTX executives and their support team, it seems to me like they don't even care about maintenance or their users' needs. I guess this is the result of them implementing new services too fast and only caring about growing their overall numbers.

Upgrade guide

First, make sure to update Jesse to 0.27.3, and the live trade plugin to 0.0.11. Next, you need to add config values for FTX Futures. First, open your plugins.py file and it should look like this:

from jesse.modes.import_candles_mode.drivers.binance import Binance
from jesse.modes.import_candles_mode.drivers.binance_futures import BinanceFutures
from jesse.modes.import_candles_mode.drivers.binance_inverse_futures import BinanceInverseFutures
from jesse.modes.import_candles_mode.drivers.bitfinex import Bitfinex
from jesse.modes.import_candles_mode.drivers.coinbase import Coinbase
from jesse.modes.import_candles_mode.drivers.testnet_binance_futures import TestnetBinanceFutures
from jesse.modes.import_candles_mode.drivers.bybit_perpetual import BybitPerpetual
from jesse.modes.import_candles_mode.drivers.testnet_bybit_perpetual import TestnetBybitPerpetual
from jesse.modes.import_candles_mode.drivers.ftx_futures import FTXFutures

import_candles_drivers = {
    'Binance': Binance,
    'Binance Futures': BinanceFutures,
    'Binance Inverse Futures': BinanceInverseFutures,
    'Testnet Binance Futures': TestnetBinanceFutures,
    'Bitfinex': Bitfinex,
    'Coinbase': Coinbase,
    'Bybit Perpetual': BybitPerpetual,
    'Testnet Bybit Perpetual': TestnetBybitPerpetual,
    'FTX Futures': FTXFutures,
}

Then open your config.py file and add:

'FTX Futures': {
    'fee': 0.0006,

    # backtest mode only: accepted are 'spot' and 'futures'
    # 'spot' support is currently very limited - you can use 'futures' with leverage 1 for now
    'type': 'futures',

    # futures mode only
    'settlement_currency': 'USD',
    # accepted values are: 'cross' and 'isolated'
    'futures_leverage_mode': 'cross',
    # FTX only allows for 1x, 3x, 5x, 10x, 20x values
    'futures_leverage': 3,

    'assets': [
        {'asset': 'USD', 'balance': 10_000},
    ],
},

'Testnet Bybit Perpetual': {
    'fee': 0.00075,

    # backtest mode only: accepted are 'spot' and 'futures'
    # 'spot' support is currently very limited - you can use 'futures' with leverage 1 for now
    'type': 'futures',

    # futures mode only
    'settlement_currency': 'USDT',
    # accepted values are: 'cross' and 'isolated'
    'futures_leverage_mode': 'cross',
    # 1x, 2x, 10x, 50x, etc. Enter as integers
    'futures_leverage': 1,

    'assets': [
        {'asset': 'USDT', 'balance': 10_000},
    ],
},

'Bybit Perpetual': {
    'fee': 0.00075,

    # backtest mode only: accepted are 'spot' and 'futures'
    # 'spot' support is currently very limited - you can use 'futures' with leverage 1 for now
    'type': 'futures',

    # futures mode only
    'settlement_currency': 'USDT',
    # accepted values are: 'cross' and 'isolated'
    'futures_leverage_mode': 'cross',
    # 1x, 2x, 10x, 50x, etc. Enter as integers
    'futures_leverage': 1,

    'assets': [
        {'asset': 'USDT', 'balance': 10_000},
    ],
},      

Next in case of live trading, add these values at your live-config.py file:

'FTX Futures': {
    'api_key': '',
    'api_secret': '',
    # leave empty if it's not a subaccount
    'subaccount_name': '',
},

What's next?

I couldn't be more excited about the next step for Jesse. Which is to finish and release the initial version of the GUI dashboard.

Thank you for your support,

Happy algo trading

❤️ Like Jesse?

If you like this project, please consider supporting me for free by using my referral links.

It's a win-win, you get free discounts and bonuses, and it helps me to develop more features and content:


Thank you 🙏