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

Method fetch_mark_price

python/ccxt/bitget.py:3465–3489  ·  view source on GitHub ↗

fetches the mark price for a specific market https://www.bitget.com/api-doc/contract/market/Get-Symbol-Price :param str symbol: unified symbol of the market to fetch the ticker for :param dict [params]: extra parameters specific to the exchange API endpoint

(self, symbol: str, params={})

Source from the content-addressed store, hash-verified

3463 return self.parse_ticker(data[0], market)
3464
3465 def fetch_mark_price(self, symbol: str, params={}) -> Ticker:
3466 """
3467 fetches the mark price for a specific market
3468
3469 https://www.bitget.com/api-doc/contract/market/Get-Symbol-Price
3470
3471 :param str symbol: unified symbol of the market to fetch the ticker for
3472 :param dict [params]: extra parameters specific to the exchange API endpoint
3473 :returns dict: a `ticker structure <https://docs.ccxt.com/?id=ticker-structure>`
3474 """
3475 self.load_markets()
3476 market = self.market(symbol)
3477 request = {
3478 'symbol': market['id'],
3479 }
3480 response = None
3481 if market['spot']:
3482 raise NotSupported(self.id + ' fetchMarkPrice() is not supported for spot markets')
3483 else:
3484 productType = None
3485 productType, params = self.handle_product_type_and_params(market, params)
3486 request['productType'] = productType
3487 response = self.publicMixGetV2MixMarketSymbolPrice(self.extend(request, params))
3488 data = self.safe_list(response, 'data', [])
3489 return self.parse_ticker(data[0], market)
3490
3491 def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
3492 """

Callers

nothing calls this directly

Calls 8

parse_tickerMethod · 0.95
NotSupportedClass · 0.90
safe_listMethod · 0.80
load_marketsMethod · 0.45
marketMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected