From 693c7ce12a0b5b136cd518ae370c4f1968b71f01 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 6 Jul 2022 10:30:32 -0400 Subject: [PATCH] Use our struct for kraken `Pair` type --- piker/brokers/kraken/feed.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/piker/brokers/kraken/feed.py b/piker/brokers/kraken/feed.py index 2d6ecbf1..4966db8a 100644 --- a/piker/brokers/kraken/feed.py +++ b/piker/brokers/kraken/feed.py @@ -31,7 +31,6 @@ import time from fuzzywuzzy import process as fuzzy import numpy as np import pendulum -from pydantic import BaseModel from trio_typing import TaskStatus import tractor import trio @@ -45,6 +44,7 @@ from piker.brokers._util import ( ) from piker.log import get_console_log from piker.data import ShmArray +from piker.data.types import Struct from piker.data._web_bs import open_autorecon_ws, NoBsWs from . import log from .api import ( @@ -54,7 +54,7 @@ from .api import ( # https://www.kraken.com/features/api#get-tradable-pairs -class Pair(BaseModel): +class Pair(Struct): altname: str # alternate pair name wsname: str # WebSocket pair name (if available) aclass_base: str # asset class of base component @@ -347,7 +347,7 @@ async def stream_quotes( sym = sym.upper() si = Pair(**await client.symbol_info(sym)) # validation - syminfo = si.dict() + syminfo = si.to_dict() syminfo['price_tick_size'] = 1 / 10**si.pair_decimals syminfo['lot_tick_size'] = 1 / 10**si.lot_decimals syminfo['asset_type'] = 'crypto'