Skip to main content

Ticker

Subscribe to the ticker stream.

note
  • This topic utilises the snapshot field and delta field. If a response param is not found in the message, then its value has not changed.
  • Spot & Option tickers message are snapshot only

Push frequency: Derivatives & Options - 100ms, Spot - real-time

Topic:
tickers.{symbol}

Response Parameters

ParameterTypeComments
topicstringTopic name
typestringData type. snapshot,delta
csintegerCross sequence
tsnumberThe timestamp (ms) that the system generates the data
dataarrayObject
> symbolstringSymbol name
> tickDirectionstringTick direction
> price24hPcntstringPercentage change of market price in the last 24 hours
> lastPricestringLast price
> prevPrice24hstringMarket price 24 hours ago
> highPrice24hstringThe highest price in the last 24 hours
> lowPrice24hstringThe lowest price in the last 24 hours
> prevPrice1hstringMarket price an hour ago
> markPricestringMark price
> indexPricestringIndex price
> openIntereststringOpen interest size
> openInterestValuestringOpen interest value
> turnover24hstringTurnover for 24h
> volume24hstringVolume for 24h
> nextFundingTimestringNext funding timestamp (ms)
> fundingRatestringFunding rate
> bid1PricestringBest bid price
> bid1SizestringBest bid size
> ask1PricestringBest ask price
> ask1SizestringBest ask size
> deliveryTimedatetimeDelivery date time (UTC+0). Unique field for inverse futures & USDC futures
> basisRatestringBasis rate. Unique field for inverse futures & USDC futures
> deliveryFeeRatestringDelivery fee rate. Unique field for inverse futures & USDC futures
> predictedDeliveryPricestringPredicated delivery price. Unique field for inverse futures & USDC futures
> preOpenPricestringEstimated pre-market contract open price
  • The value is meaningless when entering continuous trading phase
  • USDC Futures and Inverse Futures do not have this field
  • > preQtystringEstimated pre-market contract open qty
  • The value is meaningless when entering continuous trading phase
  • USDC Futures and Inverse Futures do not have this field
  • > curPreListingPhasestringThe current pre-market contract phase
  • USDC Futures and Inverse Futures do not have this field
  • Subscribe Example

    from pybit.unified_trading import WebSocket
    from time import sleep
    ws = WebSocket(
    testnet=True,
    channel_type="linear",
    )
    def handle_message(message):
    print(message)
    ws.ticker_stream(
    symbol="BTCUSDT",
    callback=handle_message
    )
    while True:
    sleep(1)

    Response Example

    {
    "topic": "tickers.BTCUSDT",
    "type": "snapshot",
    "data": {
    "symbol": "BTCUSDT",
    "tickDirection": "PlusTick",
    "price24hPcnt": "0.017103",
    "lastPrice": "17216.00",
    "prevPrice24h": "16926.50",
    "highPrice24h": "17281.50",
    "lowPrice24h": "16915.00",
    "prevPrice1h": "17238.00",
    "markPrice": "17217.33",
    "indexPrice": "17227.36",
    "openInterest": "68744.761",
    "openInterestValue": "1183601235.91",
    "turnover24h": "1570383121.943499",
    "volume24h": "91705.276",
    "nextFundingTime": "1673280000000",
    "fundingRate": "-0.000212",
    "bid1Price": "17215.50",
    "bid1Size": "84.489",
    "ask1Price": "17216.00",
    "ask1Size": "83.020"
    },
    "cs": 24987956059,
    "ts": 1673272861686
    }