From 265638bb051d6086bffcfb1a50f9c161aafc014c Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Sun, 1 Aug 2021 22:38:33 -0600 Subject: [PATCH] Added liq-formula to exchange classes --- freqtrade/exchange/binance.py | 1 + freqtrade/exchange/exchange.py | 1 + freqtrade/exchange/ftx.py | 5 +++-- freqtrade/exchange/kraken.py | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/freqtrade/exchange/binance.py b/freqtrade/exchange/binance.py index 357d49cd8..48730fa98 100644 --- a/freqtrade/exchange/binance.py +++ b/freqtrade/exchange/binance.py @@ -25,6 +25,7 @@ class Binance(Exchange): "l2_limit_range": [5, 10, 20, 50, 100, 500, 1000], } interest_mode: InterestMode = InterestMode.HOURSPERDAY + liq_formula: LiqFormula = LiqFormula.BINANCE maintenance_margin_formula = LiqFormula.BINANCE diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 388a0165e..b4cd01ef8 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -71,6 +71,7 @@ class Exchange: _ft_has: Dict = {} liq_formula: LiqFormula interest_mode: InterestMode = InterestMode.NONE + liq_formula: LiqFormula = LiqFormula.NONE def __init__(self, config: Dict[str, Any], validate: bool = True) -> None: """ diff --git a/freqtrade/exchange/ftx.py b/freqtrade/exchange/ftx.py index efa00516b..41a466650 100644 --- a/freqtrade/exchange/ftx.py +++ b/freqtrade/exchange/ftx.py @@ -5,6 +5,7 @@ from typing import Any, Dict import ccxt from freqtrade.enums import LiqFormula +#from freqtrade.enums import InterestMode, LiqFormula from freqtrade.exceptions import (DDosProtection, InsufficientFundsError, InvalidOrderException, OperationalException, TemporaryError) from freqtrade.exchange import Exchange @@ -21,8 +22,8 @@ class Ftx(Exchange): "stoploss_on_exchange": True, "ohlcv_candle_limit": 1500, } - - maintenance_margin_formula = LiqFormula.FTX + #interest_mode: InterestMode = InterestMode.HOURSPERDAY + liq_formula: LiqFormula = LiqFormula.FTX def market_is_tradable(self, market: Dict[str, Any]) -> bool: """ diff --git a/freqtrade/exchange/kraken.py b/freqtrade/exchange/kraken.py index a722eae1f..ef7cfa17b 100644 --- a/freqtrade/exchange/kraken.py +++ b/freqtrade/exchange/kraken.py @@ -24,6 +24,7 @@ class Kraken(Exchange): "trades_pagination_arg": "since", } interest_mode: InterestMode = InterestMode.HOURSPER4 + liq_formula: LiqFormula = LiqFormula.KRAKEN maintenance_margin_formula = LiqFormula.KRAKEN