From 888951288777b8e7a65de42961e74c53ba95a811 Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Tue, 11 Jan 2022 21:17:29 -0600 Subject: [PATCH] freqtradebot.leverage_prep gets taker_fee_rate --- freqtrade/freqtradebot.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index 80656f209..6e11f3eb1 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -616,10 +616,12 @@ class FreqtradeBot(LoggingMixin): # open_rate=open_rate, # is_short=is_short # ) - mm_ratio, maintenance_amt = self.exchange.get_maintenance_ratio_and_amt(pair, amount) if self.collateral_type == Collateral.ISOLATED: if self.config['dry_run']: + mm_ratio, maintenance_amt = self.exchange.get_maintenance_ratio_and_amt( + pair, amount) + taker_fee_rate = self.exchange.markets[pair]['taker'] isolated_liq = liquidation_price( exchange_name=self.exchange.name, open_rate=open_rate, @@ -633,6 +635,13 @@ class FreqtradeBot(LoggingMixin): wallet_balance=amount/leverage, # TODO: Update for cross maintenance_amt=maintenance_amt, mm_ratio=mm_ratio, + taker_fee_rate=taker_fee_rate + + # Okex + # liability: Optional[float]=None, + # interest: Optional[float]=None, + # position_assets: Optional[float]=None, # * Might be same as position + ) else: isolated_liq = self.exchange.get_liquidation_price(pair)