Skip to content

Commit

Permalink
tweak docs for python blockchain
Browse files Browse the repository at this point in the history
  • Loading branch information
crispheaney committed Jan 25, 2024
1 parent b1e815a commit 474540e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions source/includes/_orderbook_blockchain.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ from driftpy.keypair import load_keypair
from driftpy.user_map.user_map import UserMap
from driftpy.user_map.user_map_config import UserMapConfig, WebsocketConfig

connection = AsyncClient("https://api.mainnet-beta.solana/com")
connection = AsyncClient("https://api.mainnet-beta.solana.com") # switch for your own rpc

keypair_file = "~/.config/solana/my-keypair.json"
keypair_file = "" # path to keypair file

wallet = Wallet(load_keypair(keypair_file))

drift_client = DriftClient(
connnection,
connection,
wallet,
"mainnet"
)
Expand Down Expand Up @@ -157,8 +157,11 @@ await dlobSubscriber.subscribe();
```python
from driftpy.dlob.dlob_subscriber import DLOBSubscriber
from driftpy.dlob.client_types import DLOBClientConfig
from driftpy.slot.slot_subscriber import SlotSubscriber

slot_subscriber = SlotSubscriber(drift_client)

config = DLOBClientConfig(drift_client, user_map, slot_subscriber, 1_000)
config = DLOBClientConfig(drift_client, user_map, slot_subscriber, 1)
dlob_subscriber = DLOBSubscriber(config = config)

await dlob_subscriber.subscribe()
Expand Down

0 comments on commit 474540e

Please sign in to comment.