Added validating checks for trading_mode and collateral on each exchange

This commit is contained in:
Sam Germain
2021-09-04 21:55:55 -06:00
parent d1c4030b88
commit 9e73d02663
5 changed files with 133 additions and 23 deletions

View File

@@ -1,9 +1,10 @@
""" FTX exchange subclass """
import logging
from typing import Any, Dict, Optional
from typing import Any, Dict, List, Optional, Tuple
import ccxt
from freqtrade.enums import Collateral, TradingMode
from freqtrade.exceptions import (DDosProtection, InsufficientFundsError, InvalidOrderException,
OperationalException, TemporaryError)
from freqtrade.exchange import Exchange
@@ -21,6 +22,12 @@ class Ftx(Exchange):
"ohlcv_candle_limit": 1500,
}
_supported_trading_mode_collateral_pairs: List[Tuple[TradingMode, Collateral]] = [
# TradingMode.SPOT always supported and not required in this list
# (TradingMode.MARGIN, Collateral.CROSS), # TODO-lev: Uncomment once supported
# (TradingMode.FUTURES, Collateral.CROSS) # TODO-lev: Uncomment once supported
]
def market_is_tradable(self, market: Dict[str, Any]) -> bool:
"""
Check if the market symbol is tradable by Freqtrade.