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

Method parse_long_short_ratio

python/ccxt/async_support/binance.py:13721–13752  ·  view source on GitHub ↗
(self, info: dict, market: Market = None)

Source from the content-addressed store, hash-verified

13719 return self.parse_long_short_ratio_history(response, market)
13720
13721 def parse_long_short_ratio(self, info: dict, market: Market = None) -> LongShortRatio:
13722 #
13723 # linear
13724 #
13725 # {
13726 # "symbol": "BTCUSDT",
13727 # "longAccount": "0.4558",
13728 # "longShortRatio": "0.8376",
13729 # "shortAccount": "0.5442",
13730 # "timestamp": 1726790400000
13731 # }
13732 #
13733 # inverse
13734 #
13735 # {
13736 # "longAccount": "0.7262",
13737 # "longShortRatio": "2.6523",
13738 # "shortAccount": "0.2738",
13739 # "pair": "BTCUSD",
13740 # "timestamp": 1726790400000
13741 # }
13742 #
13743 marketId = self.safe_string(info, 'symbol')
13744 timestamp = self.safe_integer_omit_zero(info, 'timestamp')
13745 return {
13746 'info': info,
13747 'symbol': self.safe_symbol(marketId, market, None, 'contract'),
13748 'timestamp': timestamp,
13749 'datetime': self.iso8601(timestamp),
13750 'timeframe': None,
13751 'longShortRatio': self.safe_number(info, 'longShortRatio'),
13752 }
13753
13754 async def fetch_adl_rank(self, symbol: str, params={}) -> ADL:
13755 """

Callers

nothing calls this directly

Calls 5

safe_stringMethod · 0.80
safe_symbolMethod · 0.80
safe_numberMethod · 0.80
iso8601Method · 0.45

Tested by

no test coverage detected