diff --git a/piker/brokers/deribit/api.py b/piker/brokers/deribit/api.py index e3c52f28..86e6e0f4 100644 --- a/piker/brokers/deribit/api.py +++ b/piker/brokers/deribit/api.py @@ -319,6 +319,20 @@ class Client: return balances + async def get_currencies( + self, + + ) -> list[dict]: + ''' + Return the set of currencies for deribit. + ''' + assets = {} + resp = await self._json_rpc_auth_wrapper( + 'public/get_currencies', + params={} + ) + return resp.result + async def get_assets( self, venue: str | None = None, @@ -331,11 +345,7 @@ class Client: ''' assets = {} - resp = await self._json_rpc_auth_wrapper( - 'public/get_currencies', - params={} - ) - currencies: list[dict] = resp.result + currencies = await self.get_currencies() for currency in currencies: name: str = currency['currency'] tx_tick: Decimal = digits_to_dec(currency['fee_precision']) @@ -844,6 +854,8 @@ async def open_oi_feed( instruments: list[Symbol] async with get_client( ) as client: + # to get all currencies available in deribit + # currencies = await client.get_currencies() instruments = await client.get_instruments() fh: FeedHandler