Skip to content

Commit

Permalink
Set predicted funding rate to None in OKX if nextFundingRate is empty. (
Browse files Browse the repository at this point in the history
  • Loading branch information
agijsberts authored Jan 15, 2024
1 parent 765bbf5 commit bbaee2e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Changelog

### 2.4.1
* Bugfix: Handle empty nextFundingRate in OKX

### 2.4.0 (2024-01-07)
* Update: Fix tests
* Update: Okcoin moved to v5 API used by OKX
Expand Down
2 changes: 1 addition & 1 deletion cryptofeed/exchanges/okx.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ async def _funding(self, msg: dict, timestamp: float):
Decimal(update['fundingRate']),
None,
self.timestamp_normalize(int(update['fundingTime'])),
predicted_rate=Decimal(update['nextFundingRate']),
predicted_rate=Decimal(update['nextFundingRate']) if update['nextFundingRate'] != '' else None,
raw=update
)
await self.callback(FUNDING, f, timestamp)
Expand Down

0 comments on commit bbaee2e

Please sign in to comment.