Instrument Subscription

Subscribe to detailed instrument information updates.

Subscribe Request

{
  "id": 3,
  "method": "SUBSCRIBE",
  "params": {
    "chainId": 143,
    "instrument": "0x73ada1ea346cc3908f41cf67a040f0acd7808be0",
    "expiry": 4294967295,
    "type": "instrument"
  }
}

Unsubscribe Request

{
  "id": 3,
  "method": "UNSUBSCRIBE",
  "params": {
    "chainId": 143,
    "instrument": "0x73ada1ea346cc3908f41cf67a040f0acd7808be0",
    "expiry": 4294967295,
    "type": "instrument"
  }
}

Parameter Description

  • chainId (required): Chain ID

  • instrument (required): Instrument address (lowercase)

  • expiry (required): Expiry timestamp

  • type (required): Must be "instrument"

Data Stream Messages

When subscribing to instrument, you will receive two types of messages:

1. Instrument Information (instrument)

Complete instrument information update:

Instrument Information Data Structure

  • instrumentAddr: Instrument address

  • symbol: Trading pair symbol

  • market: Market information

    • info: Market basic information (address, type, beacon)

    • config: Market configuration (daily interest rate, feeder sources)

    • feeder: Market feeder information (aggregators, heartbeats)

  • condition: Instrument condition status

  • setting: Instrument settings

    • initialMarginRatio: Initial margin ratio

    • maintenanceMarginRatio: Maintenance margin ratio

    • quoteParam: Quote parameters (min margin amount, fee ratios, etc.)

  • spotPrice: Spot price

  • amms: Array of AMM states, containing:

    • expiry: Expiry timestamp

    • timestamp: Timestamp

    • status: AMM status

    • tick: Current tick

    • sqrtPX96: Square root price in X96 format

    • liquidity: Current liquidity

    • totalLiquidity: Total liquidity

    • totalShort: Total short positions

    • openInterests: Open interest

    • totalLong: Total long positions

    • involvedFund: Involved fund amount

    • feeIndex: Fee index

    • protocolFee: Protocol fee

    • longSocialLossIndex: Long social loss index

    • shortSocialLossIndex: Short social loss index

    • longFundingIndex: Long funding index

    • shortFundingIndex: Short funding index

    • insuranceFund: Insurance fund amount

    • settlementPrice: Settlement price

    • markPrice: Mark price

    • fairPrice: Fair price

    • blockInfo: Block information (height, timestamp)

  • base: Base token information (symbol, address, decimals, name)

  • quote: Quote token information (symbol, address, decimals, name)

  • blockInfo: Block information (height, timestamp)

  • placePaused: Whether placing orders is paused

  • fundingHour: Funding hour

  • disableOrderRebate: Whether order rebate is disabled

  • instrumentType: Instrument type

  • marketType: Market type (e.g., "perp")

  • minTradeValue: Minimum trade value

  • minOrderValue: Minimum order value

  • minRangeValue: Minimum range value

  • displayBase: Display base token information

  • displayQuote: Display quote token information

  • minTickDelta: Minimum tick delta

2. Market Pair Info Changed (marketPairInfoChanged)

Market pair information update (prices, volumes, etc.):

Note: This message is sent when market pair information (prices, volumes, etc.) changes. It provides a lightweight update focused on market data, while the instrument message provides complete instrument state information.

Market Pair Info Changed Data Structure

  • instrumentAddr: Instrument address

  • expiry: Expiry timestamp

  • symbol: Trading pair symbol (e.g., "ETH/USD")

  • fullSymbol: Full trading pair symbol with expiry (e.g., "ETH/USD-PERP")

  • baseToken: Base token information

    • symbol: Token symbol

    • address: Token address

    • decimals: Token decimals

    • price: Current token price

    • image: Token image URL

  • quoteToken: Quote token information

    • symbol: Token symbol

    • address: Token address

    • decimals: Token decimals

    • price: Current token price

    • image: Token image URL

  • markPrice: Mark price (string)

  • fairPrice: Fair price (string)

  • spotPrice: Spot price (string)

  • fairPriceChange24h: Fair price change percentage over 24 hours (string)

  • baseVolume24h: Base token volume over 24 hours (string)

  • quoteVolume24h: Quote token volume over 24 hours (string)

  • volume24hUsd: Total volume in USD over 24 hours (string)

  • openInterests: Open interest amount (string)

  • openInterestsUsd: Open interest in USD (string)

  • tvl: Total value locked (string)

  • tvlUsd: Total value locked in USD (string)

  • longOi: Long open interest (string)

  • shortOi: Short open interest (string)

  • periods1hFunding: 1-hour periods funding rate

    • long: Long funding rate

    • short: Short funding rate

  • last1hFunding: Last 1-hour funding rate

    • long: Long funding rate

    • short: Short funding rate

  • fundingRatePerHour: Funding rate per hour (string)

  • poolFee24h: Pool fee over 24 hours (string)

  • maxLeverage: Maximum leverage (number)

  • updateTime: Last update timestamp (number)

  • marketType: Market type (e.g., "perp")

  • condition: Instrument condition status (number)

  • ammStatus: AMM status (number)

Last updated