Skip to content

Commit

Permalink
fix: priority fee sub blocks (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
soundsonacid authored Jan 18, 2024
1 parent 096af04 commit 1694f8a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.7.14
current_version = 0.7.15
commit = True
tag = True
tag_name = {new_version}
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,8 @@ Add default `Confirmed` commitment in `StandardTxSender`

## [0.7.14] - 2024-1-18

Add `PriorityFeeSubscriber`
Add `PriorityFeeSubscriber`

## [0.7.15] - 2024-1-18

Fix bug where `PriorityFeeSubscriber.subscribe()` blocks
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "driftpy"
version = "0.7.14"
version = "0.7.15"
description = "A Python client for the Drift DEX"
authors = ["x19 <https://twitter.com/[email protected]>", "bigz <https://twitter.com/bigz_pubkey>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion src/driftpy/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.7.14"
__version__ = "0.7.15"
8 changes: 6 additions & 2 deletions src/driftpy/priority_fees/priority_fee_subscriber.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import jsonrpcclient

from dataclasses import dataclass
from typing import Optional

from solana.rpc.async_api import AsyncClient
from solders.pubkey import Pubkey
Expand Down Expand Up @@ -35,8 +34,11 @@ async def subscribe(self):

self.subscribed = True

asyncio.create_task(self.poll())

async def poll(self):
while self.subscribed:
await self.load()
asyncio.create_task(self.load())
await asyncio.sleep(self.frequency_ms)

async def load(self):
Expand Down Expand Up @@ -70,6 +72,8 @@ async def load(self):
) / len(desc_results)
self.max_priority_fee = max(item["prioritizationFee"] for item in desc_results)

print("loaded")

async def unsubscribe(self):
if self.subscribed:
self.subscribed = False

0 comments on commit 1694f8a

Please sign in to comment.