Add test for "combine_funding_and_mark", fix bug

This commit is contained in:
Matthias
2022-05-21 09:03:30 +02:00
parent 2df42a3035
commit 0d388b561b
2 changed files with 68 additions and 2 deletions

View File

@@ -2437,9 +2437,11 @@ class Exchange:
else:
# Fill up missing funding_rate candles with fallback value
return mark_rates.merge(
combined = mark_rates.merge(
funding_rates, on='date', how="outer", suffixes=["_mark", "_fund"]
)['open_fund'].fillna(futures_funding_rate)
)
combined['open_fund'] = combined['open_fund'].fillna(futures_funding_rate)
return combined
def calculate_funding_fees(
self,