Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set predicted funding rate to None in OKX if nextFundingRate is empty. #1003

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading