Updated time to utc in test_update_funding_fees, some funding rate key errors because a timestamp is likely not in utc

This commit is contained in:
Sam Germain
2021-11-06 05:56:58 -06:00
parent fd63fa7dda
commit cb97c6f388
3 changed files with 4 additions and 2 deletions

View File

@@ -1711,6 +1711,8 @@ class Exchange:
def _get_funding_fee_dates(self, d1: datetime, d2: datetime):
d1_hours = d1.hour + 1 if self.funding_fee_cutoff(d1) else d1.hour
if d1_hours == 24:
d1_hours = 0
d1 = datetime(d1.year, d1.month, d1.day, d1_hours, tzinfo=timezone.utc)
d2 = datetime(d2.year, d2.month, d2.day, d2.hour, tzinfo=timezone.utc)

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,