Fixed issues with funding-fee being miscalculated on trade objects in freqtradebot

This commit is contained in:
Sam Germain 2021-11-06 21:03:18 -06:00
parent f795288d90
commit 48b34c8fd0
2 changed files with 2 additions and 2 deletions

View File

@ -275,7 +275,7 @@ class FreqtradeBot(LoggingMixin):
trade.pair,
trade.amount,
trade.open_date
) + (trade.funding_fees or 0.0)
)
else:
funding_fees = self.exchange.get_funding_fees_from_exchange(
trade.pair,

View File

@ -4780,7 +4780,7 @@ def test_update_funding_fees(mocker, default_conf, time_machine, fee):
trades = Trade.get_open_trades()
for trade in trades:
assert trade.funding_fees == sum([
123 *
trade.amount *
mark_prices[trade.pair][time] *
funding_rates[trade.pair][time] for time in mark_prices[trade.pair].keys()
])