Skip to content

Commit

Permalink
discrepancy between live/testnet urls
Browse files Browse the repository at this point in the history
  • Loading branch information
ebisu4 committed Jul 11, 2023
1 parent 35af5f1 commit 2ac8191
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion piker/brokers/binance/broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ async def open_trade_dialog(
wss: NoBsWs
async with (
client.manage_listen_key() as listen_key,
open_autorecon_ws(f'{wss_url}/ws/{listen_key}') as wss,
open_autorecon_ws(f'{wss_url}/?listenKey={listen_key}') as wss,
):
nsid: int = time_ns()
await wss.send_msg({
Expand Down
6 changes: 3 additions & 3 deletions piker/brokers/binance/venues.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
# 'wss://ws-api.binance.com:443/ws-api/v3',

# https://binance-docs.github.io/apidocs/futures/en/#websocket-market-streams
_futes_ws: str = f'wss://fstream.{_domain}/ws/'
_auth_futes_ws: str = 'wss://fstream-auth.{_domain}/ws/'
_futes_ws: str = f'wss://fstream.{_domain}/ws'
_auth_futes_ws: str = 'wss://fstream-auth.{_domain}/ws'

# test nets
# NOTE: spot test network only allows certain ep sets:
Expand All @@ -58,7 +58,7 @@
# 'wss://testnet.binance.vision/ws-api/v3'

_testnet_futes_url: str = 'https://testnet.binancefuture.com'
_testnet_futes_ws: str = 'wss://stream.binancefuture.com'
_testnet_futes_ws: str = 'wss://stream.binancefuture.com/ws'


MarketType = Literal[
Expand Down

2 comments on commit 2ac8191

@goodboy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me. only thing i'd suggest is maybe use the params api in asks to do the listen key bit?

@goodboy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh wait nm 😂 this is wss lul.

yeah i don't think they have an api for it, so this looks good to me.

If you want to check see docs:
https://trio-websocket.readthedocs.io/en/stable/clients.html

Please sign in to comment.