Removed exchange file modifications
This commit is contained in:
parent
a4403c0814
commit
5fc587c225
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user