diff --git a/freqtrade/exchange/binance.py b/freqtrade/exchange/binance.py index a8d60d6c0..0c470cb24 100644 --- a/freqtrade/exchange/binance.py +++ b/freqtrade/exchange/binance.py @@ -3,7 +3,6 @@ import logging from typing import Dict import ccxt -from decimal import Decimal from freqtrade.exceptions import (DDosProtection, InsufficientFundsError, InvalidOrderException, OperationalException, TemporaryError) @@ -90,12 +89,3 @@ class Binance(Exchange): f'Could not place sell order due to {e.__class__.__name__}. Message: {e}') from e except ccxt.BaseError as e: raise OperationalException(e) from e - - @staticmethod - def calculate_interest(borrowed: Decimal, hours: Decimal, interest_rate: Decimal) -> Decimal: - # Rate is per day but accrued hourly or something - # binance: https://www.binance.com/en-AU/support/faq/360030157812 - one = Decimal(1) - twenty_four = Decimal(24) - # TODO-mg: Is hours rounded? - return borrowed * interest_rate * max(hours, one)/twenty_four diff --git a/freqtrade/exchange/kraken.py b/freqtrade/exchange/kraken.py index 2cd2ac118..1b069aa6c 100644 --- a/freqtrade/exchange/kraken.py +++ b/freqtrade/exchange/kraken.py @@ -3,7 +3,6 @@ import logging from typing import Any, Dict import ccxt -from decimal import Decimal from freqtrade.exceptions import (DDosProtection, InsufficientFundsError, InvalidOrderException, OperationalException, TemporaryError) @@ -125,11 +124,3 @@ class Kraken(Exchange): f'Could not place sell order due to {e.__class__.__name__}. Message: {e}') from e except ccxt.BaseError as e: raise OperationalException(e) from e - - @staticmethod - def calculate_interest(borrowed: Decimal, hours: Decimal, interest_rate: Decimal) -> Decimal: - four = Decimal(4.0) - # https://support.kraken.com/hc/en-us/articles/206161568-What-are-the-fees-for-margin-trading- - opening_fee = borrowed * interest_rate - roll_over_fee = borrowed * interest_rate * max(0, (hours-four)/four) - return opening_fee + roll_over_fee