Skip to main content

CoinMetricsClient.get_market_contract_prices

coinmetrics.api_client.CoinMetricsClient.get_market_contract_prices(
markets,
page_size=None,
paging_from='start',
start_time=None,
end_time=None,
start_inclusive=None,
end_inclusive=None,
granularity=None,
timezone=None,
limit_per_market=None,
frequency=None,
format='json_stream',
)

Returns contract prices for specified markets. This includes index price and mark price that are used by the exchange for settlement and risk management purposes.

  • Parameters:
    • markets (list (str ) , str) -- list of market ids. Market ids use the following naming convention: exchangeName-baseAsset-quoteAsset-spot for spot markets, exchangeName-futuresSymbol-future for futures markets, and exchangeName-optionsSymbol-option for options markets. e.g., 'coinbase-btc-usd-spot', 'bitmex-XBTUSD-future', 'deribit-ETH-25MAR22-1200-P-option'
    • page_size (int) -- number of items returned per page when calling the API. If the request times out, try using a smaller number.
    • paging_from (PagingFrom , str) -- Defines where you want to start receiving items from, 'start' or 'end' of the timeseries.
    • start_time (datetime , date , str) -- Start time of the timeseries (string or datetime). Datetime object may be timezone naive or aware. Multiple formats of ISO 8601 are supported: 2006-01-20T00:00:00Z, 2006-01-20T00:00:00.000Z, 2006-01-20T00:00:00.123456Z, 2006-01-20T00:00:00.123456789, 2006-01-20, 20060120
    • end_time (datetime , date , str) -- End time of the timeseries (string or datetime). Datetime object may be timezone naive or aware. Multiple formats of ISO 8601 are supported: 2006-01-20T00:00:00Z, 2006-01-20T00:00:00.000Z, 2006-01-20T00:00:00.123456Z, 2006-01-20T00:00:00.123456789, 2006-01-20, 20060120
    • start_inclusive (bool) -- Flag to define if start timestamp must be included in the timeseries if present. True by default.
    • end_inclusive (bool) -- Flag to define if end timestamp must be included in the timeseries if present. True by default.
    • granularity (str) -- Downsampling granularity of market contract prices. Supported values are raw, 1m, 1h, and 1d.
    • timezone (str) -- timezone of the start/end times in db format for example: "America/Chicago". Default value is "UTC". For more details check out API documentation page.
    • limit_per_market (int) -- How many entries per market the result should contain.
    • format (str) -- Format of the response. Supported values are json, json_stream, csv. Default is json.
    • frequency (str | None)

Returns: