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

Method fetch_mark_price

python/ccxt/async_support/bitget.py:3466–3490  ·  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

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

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