Merge pull request #431 from pikers/cz_post_ftx

Cz post ftx
dark_clearing_improvements
goodboy 2022-12-10 16:08:39 -05:00 committed by GitHub
commit 4d8b22dd8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -460,11 +460,19 @@ async def stream_quotes(
syminfo = Pair(**d) # validation
si = sym_infos[sym] = syminfo.to_dict()
filters = {}
for entry in syminfo.filters:
ftype = entry.pop('filterType')
filters[ftype] = entry
# XXX: after manually inspecting the response format we
# just directly pick out the info we need
si['price_tick_size'] = float(syminfo.filters[0]['tickSize'])
si['lot_tick_size'] = float(syminfo.filters[2]['stepSize'])
si['price_tick_size'] = float(
filters['PRICE_FILTER']['tickSize']
)
si['lot_tick_size'] = float(
filters['LOT_SIZE']['stepSize']
)
si['asset_type'] = 'crypto'
symbol = symbols[0]

View File

@ -26,6 +26,7 @@ import json
import trio
import trio_websocket
from wsproto.utilities import LocalProtocolError
from trio_websocket._impl import (
ConnectionClosed,
DisconnectionTimeout,
@ -51,6 +52,7 @@ class NoBsWs:
ConnectionRejected,
HandshakeError,
ConnectionTimeout,
LocalProtocolError,
)
def __init__(