MCPcopy Create free account
hub / github.com/ccxt/ccxt / set_positions_cache

Method set_positions_cache

python/ccxt/pro/binance.py:3862–3876  ·  view source on GitHub ↗
(self, client: Client, type, symbols: Strings = None, isPortfolioMargin=False)

Source from the content-addressed store, hash-verified

3860 return self.filter_by_symbols_since_limit(cache, symbols, since, limit, True)
3861
3862 def set_positions_cache(self, client: Client, type, symbols: Strings = None, isPortfolioMargin=False):
3863 if type == 'spot':
3864 return
3865 if self.positions is None:
3866 self.positions = {}
3867 if type in self.positions:
3868 return
3869 fetchPositionsSnapshot = self.handle_option('watchPositions', 'fetchPositionsSnapshot', False)
3870 if fetchPositionsSnapshot:
3871 messageHash = type + ':fetchPositionsSnapshot'
3872 if not (messageHash in client.futures):
3873 client.future(messageHash)
3874 self.spawn(self.load_positions_snapshot, client, messageHash, type, isPortfolioMargin)
3875 else:
3876 self.positions[type] = ArrayCacheBySymbolBySide()
3877
3878 async def load_positions_snapshot(self, client, messageHash, type, isPortfolioMargin):
3879 params = {

Callers 4

watch_balanceMethod · 0.95
watch_ordersMethod · 0.95
watch_positionsMethod · 0.95
watch_my_tradesMethod · 0.95

Calls 4

handle_optionMethod · 0.80
futureMethod · 0.45
spawnMethod · 0.45

Tested by

no test coverage detected