Market API

Liquidity channel#

Returns token liquidity-related data with a maximum push frequency of once per second.

Request URL

Please contact us dexapi@okx.com.

Request Parameters#

ParameterTypeRequiredDescription
opStringYesOperation, subscribe unsubscribe
argsArrayYesList of subscribed channels
channelStringYesChannel name,price
chainIndexStringYesUnique identifier for the chain. (e.g., 1 for Ethereum. See ChainIndex)
tokenContractAddressStringYesToken contract address,for EVM please pass all-lowercase addresses (e.g., 0x382bb369d343125bfb2117af9c149795c6c65c50)

Response Parameters#

ParameterTypeDescription
eventStringEvent, subscribe unsubscribe error
argObjectToken contract address
channelStringChannel name
chainIndexStringUnique identifier for the chain. (e.g., 1 for Ethereum. See ChainIndex)
tokenContractAddressStringToken contract address (e.g., 0x382bb369d343125bfb2117af9c149795c6c65c50)
codeStringError code
msgStringError message

Push Data Parameters#

ParameterTypeDescription
argObjectSuccessfully subscribed channel
> channelStringChannel name
> chainIndexStringUnique identifier for the chain. (e.g., 1 for Ethereum. See ChainIndex)
> tokenContractAddressStringToken contract address (e.g., 0x382bb369d343125bfb2117af9c149795c6c65c50)
dataArraySubscribed data
> timeStringTimestamp of the price, Unix timestamp format in milliseconds
> priceStringLatest token price
> marketCapStringToken marketcap
> priceChange5MString5 min price change
> priceChange1HString1 hour price change
> priceChange4HString4 hour price change
> priceChange24HString24 hour price change
> volume5MString5 min volume
> volume1HString1 hour volume
> volume4HString4 hour volume
> volume24HString24 hour volume
> txs5MString代币 5 分钟内交易笔数
>txs1HString代币 1 小时内交易笔数
>txs4HString代币 4 小时内交易笔数
>txs24HString代币 24 小时内交易笔数
>maxPriceString代币 24h 最高价格
>tradeNumString24h 代币交易数量
>minPriceString代币 24h 最低价格
>circSupplyString代币流通供应量
>liquidityString代币资金池中的流动性
>holdersString代币持仓地址数

Request Example#

shell
{
  "op": "subscribe",
  "args": [
    {
      "channel": "price-info",
      "chainIndex": "1",
      "tokenContractAddress":"0x382bb369d343125bfb2117af9c149795c6c65c50"
    }
  ]
}

Response Example#

200

Successful response example

{
  "event": "subscribe",
  "arg": {
    "channel": "price-info",
    "chainIndex": "501"
    "tokenContractAddress":"eL5fUxj2J4CiQsmW85k5FG9DvuQjjUoBHoQBi2Kpump"
  },
  "connId": "a4d3ae55"
}

Failure response example

{
  "event": "error",
  "code": "60012",
  "msg": "Invalid request: {\"op\": \"subscribe\", \"argss\":[{ \"channel\" : \"price-info\", \"chainIndex\" : \"501\", \"tokenContractAddress\" : \"eL5fUxj2J4CiQsmW85k5FG9DvuQjjUoBHoQBi2Kpump\"}]}",
  "connId": "a4d3ae55"
}

Push data example

{
  "arg": {
    "channel": "price-info",
    "chainIndex": "501"
    "tokenContractAddress":"0x382bb369d343125bfb2117af9c149795c6c65c50"
  },
  "data": [
    {
            "chainIndex": "501",
            "circSupply": "999973312.2632950000",
            "holders": "37241",
            "liquidity": "3923952.461979153265333544895656917",
            "marketCap": "19960307.19257757296691203",
            "maxPrice": "0.1656024888921609",
            "minPrice": "0.02292722724150618",
            "price": "0.019960839902217294",
            "priceChange1H": "9.12",
            "priceChange24H": "374.25",
            "priceChange4H": "68.26",
            "priceChange5M": "6.91",
            "time": "1758702741738",
            "tokenContractAddress": "eL5fUxj2J4CiQsmW85k5FG9DvuQjjUoBHoQBi2Kpump",
            "tradeNum": "2460429287.120492",
            "txs1H": "15142",
            "txs24H": "276164",
            "txs4H": "38998",
            "txs5M": "1196",
            "volume1H": "12864939.572057",
            "volume24H": "169512096.311189",
            "volume4H": "29069166.04389",
            "volume5M": "893224.505265"
    }
  ]
}