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.pair,
|
||||||
trade.amount,
|
trade.amount,
|
||||||
trade.open_date
|
trade.open_date
|
||||||
) + (trade.funding_fees or 0.0)
|
)
|
||||||
else:
|
else:
|
||||||
funding_fees = self.exchange.get_funding_fees_from_exchange(
|
funding_fees = self.exchange.get_funding_fees_from_exchange(
|
||||||
trade.pair,
|
trade.pair,
|
||||||
|
@ -4780,7 +4780,7 @@ def test_update_funding_fees(mocker, default_conf, time_machine, fee):
|
|||||||
trades = Trade.get_open_trades()
|
trades = Trade.get_open_trades()
|
||||||
for trade in trades:
|
for trade in trades:
|
||||||
assert trade.funding_fees == sum([
|
assert trade.funding_fees == sum([
|
||||||
123 *
|
trade.amount *
|
||||||
mark_prices[trade.pair][time] *
|
mark_prices[trade.pair][time] *
|
||||||
funding_rates[trade.pair][time] for time in mark_prices[trade.pair].keys()
|
funding_rates[trade.pair][time] for time in mark_prices[trade.pair].keys()
|
||||||
])
|
])
|
||||||
|
Loading…
Reference in New Issue
Block a user