Fixed issues with funding-fee being miscalculated on trade objects in freqtradebot
This commit is contained in:
parent
f795288d90
commit
48b34c8fd0
@ -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,
|
||||
|
@ -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()
|
||||
])
|
||||
|
Loading…
Reference in New Issue
Block a user