Skip to content

Commit

Permalink
Merge branch 'master' into features/coinbase_advanced_trade
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasbs17 authored Jan 26, 2024
2 parents 2ef1276 + a2ef81e commit 7a36a1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### 2.4.1
* Bugfix: Handle empty nextFundingRate in OKX
* Bugfix: Handle null next_funding_time and estimated_rate in HuobiSwap funding
* Update: transitioned from Coinbase Pro (retired) to Coinbase Advanced Trade

### 2.4.0 (2024-01-07)
Expand Down
6 changes: 3 additions & 3 deletions cryptofeed/exchanges/huobi_swap.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async def _funding(self, pairs):
data = await self.http_conn.read(endpoint)
data = json.loads(data, parse_float=Decimal)
received = time.time()
update = (data['data']['funding_rate'], self.timestamp_normalize(int(data['data']['next_funding_time'])))
update = (data['data']['funding_rate'], self.timestamp_normalize(int(data['data']['funding_time'])))
if pair in self.funding_updates and self.funding_updates[pair] == update:
await asyncio.sleep(1)
continue
Expand All @@ -97,9 +97,9 @@ async def _funding(self, pairs):
self.exchange_symbol_to_std_symbol(pair),
None,
Decimal(data['data']['funding_rate']),
self.timestamp_normalize(int(data['data']['next_funding_time'])),
self.timestamp_normalize(int(data['data']['next_funding_time'])) if data['data']['next_funding_time'] else None,
self.timestamp_normalize(int(data['data']['funding_time'])),
predicted_rate=Decimal(data['data']['estimated_rate']),
predicted_rate=Decimal(data['data']['estimated_rate']) if data['data']['estimated_rate'] is not None else None,
raw=data
)
await self.callback(FUNDING, f, received)
Expand Down

0 comments on commit 7a36a1f

Please sign in to comment.