diff --git a/piker/brokers/deribit/api.py b/piker/brokers/deribit/api.py index 84a7e06d..03757879 100644 --- a/piker/brokers/deribit/api.py +++ b/piker/brokers/deribit/api.py @@ -302,20 +302,32 @@ class Client: return balances - async def get_assets(self) -> dict[str, float]: + async def get_assets( + self, + venue: str | None = None, + + ) -> dict[str, Asset]: """Return the set of asset balances for this account by symbol. """ - balances = {} + assets = {} + resp = await self.json_rpc( + 'private/get_account_summaries', + params={ + 'extended' : True + } + ) + summaries = resp.result['summaries'] + for summary in summaries: + currency = summary['currency'] + tx_tick = Decimal('1e-08') + atype='crypto_currency' + assets[currency] = Asset( + name=currency, + atype=atype, + tx_tick=tx_tick) + return assets - for currency in self.currencies: - resp = await self.json_rpc( - 'private/get_account_summary', params={ - 'currency': currency.upper()}) - - balances[currency] = resp.result['balance'] - - return balances async def submit_limit( self,