{
  "openapi": "3.0.2",
  "info": {
    "title": "Binance Web3 WebSocket Streams",
    "description": "Real-time on-chain data streaming over WebSocket for the Binance Web3 API platform.",
    "x-description-cn": "通过 WebSocket 实时推送 Binance Web3 链上数据。",
    "version": "1.0.0",
    "termsOfService": "https://www.binance.com/en/terms",
    "contact": {
      "name": "Binance API Support",
      "url": "https://www.binance.com/en/support"
    }
  },
  "x-product-type": "ws-streams",
  "x-skip-connectors-examples": true,
  "x-auth": "web3wallet",
  "x-rate-limits-guide": "authentication#rate-limits",
  "x-rate-limits-guide-cn": "authentication#频率限制",
  "x-security-guide": "authentication",
  "x-security-guide-cn": "authentication",
  "x-api-key-guide": "https://www.binance.com/en/support/faq/detail/360002502072",
  "x-api-key-guide-cn": "https://www.binance.com/cn/support/faq/detail/360002502072",
  "externalDocs": {
    "description": "WebSocket Streams docs",
    "url": "https://web3.binance.com/en/dev-docs/products/websocket-api/introduction"
  },
  "tags": [
    {
      "name": "Market",
      "x-displayName": "行情 WebSocket",
      "x-displayName-cn": "行情 WebSocket"
    }
  ],
  "servers": [
    {
      "url": "wss://web3-stream.binance.com/w3w/stream?token={your auth token}"
    }
  ],
  "paths": {
    "/w3w@onchainos@pub@price@{chainId}@{contractAddress}": {
      "post": {
        "summary": "代币价格推送",
        "description": "代币价格推送，每次代币产生价格变动时推送。",
        "tags": ["Market"],
        "operationId": "priceStream",
        "externalDocs": {
          "url": "https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/ws-streams/market#price-stream"
        },
        "x-update-speed": "Real-time",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "e9d6b4349871b40611412680b3445fac"
            },
            "description": "唯一的 WebSocket 请求 ID。"
          },
          {
            "name": "chainId",
            "in": "path",
            "required": true,
            "description": "链唯一标识，如 \"1\"=Ethereum、\"56\"=BSC、\"CT_501\"=Solana。 支持链列表同 [「supported/chain」](/catalog/web3-wallet/api/rest-api/general-data#get-supported-chains) 接口。",
            "schema": {
              "type": "string",
              "example": "CT_501"
            }
          },
          {
            "name": "contractAddress",
            "in": "path",
            "required": true,
            "description": "代币合约地址。",
            "schema": {
              "type": "string",
              "example": "C3DwDjT17gDvvCYC2nsdGHxDHVmQRdhKfpAdqQ29pump"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "method": {
                    "type": "string",
                    "description": "WebSocket 数据流方法名称。",
                    "enum": ["SUBSCRIBE"],
                    "example": "SUBSCRIBE"
                  },
                  "params": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "要订阅的数据流列表。",
                    "example": [
                      "w3w@onchainos@pub@price@ct_501@c3dwdjt17gdvvcyc2nsdghxdhvmqrdhkfpadqq29pump"
                    ]
                  },
                  "id": {
                    "type": "string",
                    "example": "e9d6b4349871b40611412680b3445fac",
                    "description": "唯一的 WebSocket 请求 ID。"
                  }
                },
                "required": ["method", "params", "id"],
                "additionalProperties": false
              },
              "example": {
                "method": "SUBSCRIBE",
                "params": [
                  "w3w@onchainos@pub@price@ct_501@c3dwdjt17gdvvcyc2nsdghxdhvmqrdhkfpadqq29pump"
                ],
                "id": "e9d6b4349871b40611412680b3445fac"
              }
            }
          }
        },
        "responses": {
          "Successful Response": {
            "description": "代币价格推送响应。",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "stream": {
                      "type": "string",
                      "example": "w3w@onchainos@pub@price@CT_501@C3DwDjT17gDvvCYC2nsdGHxDHVmQRdhKfpAdqQ29pump",
                      "description": "Stream 名称。"
                    },
                    "data": {
                      "type": "object",
                      "description": "代币价格推送事件数据。",
                      "properties": {
                        "p": {
                          "type": "string",
                          "example": "0.00001234",
                          "description": "最新价格。"
                        },
                        "t": {
                          "type": "integer",
                          "format": "int64",
                          "example": 1700000000000,
                          "description": "价格产生时间（毫秒时间戳）。"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "stream": "w3w@onchainos@pub@price@CT_501@C3DwDjT17gDvvCYC2nsdGHxDHVmQRdhKfpAdqQ29pump",
                  "data": {
                    "p": "0.00001234",
                    "t": 1700000000000
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w3w@onchainos@pub@tx-data@{chainId}@{contractAddress}": {
      "post": {
        "summary": "代币行情指标推送",
        "description": "推送代币的行情数据。每秒最多推送一次（1s 限流）：某代币 1 秒内只要发生变化，就在该秒推送一次最新数据（多次变化只推最新值）；该秒内无变化则不推送。",
        "tags": ["Market"],
        "operationId": "marketStatsStream",
        "externalDocs": {
          "url": "https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/ws-streams/market#market-stats-stream"
        },
        "x-update-speed": "Real-time",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "e9d6b4349871b40611412680b3445fac"
            },
            "description": "唯一的 WebSocket 请求 ID。"
          },
          {
            "name": "chainId",
            "in": "path",
            "required": true,
            "description": "链唯一标识，如 \"1\"=Ethereum、\"56\"=BSC、\"CT_501\"=Solana。 支持链列表同 [「supported/chain」](/catalog/web3-wallet/api/rest-api/general-data#get-supported-chains) 接口。",
            "schema": {
              "type": "string",
              "example": "CT_501"
            }
          },
          {
            "name": "contractAddress",
            "in": "path",
            "required": true,
            "description": "代币合约地址。",
            "schema": {
              "type": "string",
              "example": "C3DwDjT17gDvvCYC2nsdGHxDHVmQRdhKfpAdqQ29pump"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "method": {
                    "type": "string",
                    "description": "WebSocket 数据流方法名称。",
                    "enum": ["SUBSCRIBE"],
                    "example": "SUBSCRIBE"
                  },
                  "params": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "要订阅的数据流列表。",
                    "example": [
                      "w3w@onchainos@pub@tx-data@ct_501@c3dwdjt17gdvvcyc2nsdghxdhvmqrdhkfpadqq29pump"
                    ]
                  },
                  "id": {
                    "type": "string",
                    "example": "e9d6b4349871b40611412680b3445fac",
                    "description": "唯一的 WebSocket 请求 ID。"
                  }
                },
                "required": ["method", "params", "id"],
                "additionalProperties": false
              },
              "example": {
                "method": "SUBSCRIBE",
                "params": [
                  "w3w@onchainos@pub@tx-data@ct_501@c3dwdjt17gdvvcyc2nsdghxdhvmqrdhkfpadqq29pump"
                ],
                "id": "e9d6b4349871b40611412680b3445fac"
              }
            }
          }
        },
        "responses": {
          "Successful Response": {
            "description": "代币行情数据推送响应。",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "stream": {
                      "type": "string",
                      "example": "w3w@onchainos@pub@tx-data@CT_501@C3DwDjT17gDvvCYC2nsdGHxDHVmQRdhKfpAdqQ29pump",
                      "description": "Stream 名称。"
                    },
                    "data": {
                      "type": "object",
                      "description": "代币行情数据推送事件数据。",
                      "properties": {
                        "p": {
                          "type": "string",
                          "example": "0.00001234",
                          "description": "最新价格（USD）。"
                        },
                        "t": {
                          "type": "integer",
                          "format": "int64",
                          "example": 1700000000000,
                          "description": "价格时间（毫秒时间戳）。"
                        },
                        "pc5m": {
                          "type": "string",
                          "example": "1.25",
                          "description": "5 分钟价格变动百分比（如 \"1.25\" 表示上涨 1.25%）。"
                        },
                        "pc1h": {
                          "type": "string",
                          "example": "3.50",
                          "description": "1 小时价格变动百分比（如 \"1.25\" 表示上涨 1.25%）。"
                        },
                        "pc4h": {
                          "type": "string",
                          "example": "-2.10",
                          "description": "4 小时价格变动百分比（如 \"1.25\" 表示上涨 1.25%）。"
                        },
                        "pc24h": {
                          "type": "string",
                          "example": "12.80",
                          "description": "24 小时价格变动百分比（如 \"1.25\" 表示上涨 1.25%）。"
                        },
                        "vol5m": {
                          "type": "string",
                          "example": "50000.00",
                          "description": "5 分钟总成交额（USD）。"
                        },
                        "vol1h": {
                          "type": "string",
                          "example": "200000.00",
                          "description": "1 小时总成交额（USD）。"
                        },
                        "vol4h": {
                          "type": "string",
                          "example": "800000.00",
                          "description": "4 小时总成交额（USD）。"
                        },
                        "vol24h": {
                          "type": "string",
                          "example": "3000000.00",
                          "description": "24 小时总成交额（USD）。"
                        },
                        "volB5m": {
                          "type": "string",
                          "example": "30000.00",
                          "description": "5 分钟买入成交额（USD）。"
                        },
                        "volS5m": {
                          "type": "string",
                          "example": "20000.00",
                          "description": "5 分钟卖出成交额（USD）。"
                        },
                        "volB1h": {
                          "type": "string",
                          "example": "120000.00",
                          "description": "1 小时买入成交额（USD）。"
                        },
                        "volS1h": {
                          "type": "string",
                          "example": "80000.00",
                          "description": "1 小时卖出成交额（USD）。"
                        },
                        "volB4h": {
                          "type": "string",
                          "example": "480000.00",
                          "description": "4 小时买入成交额（USD）。"
                        },
                        "volS4h": {
                          "type": "string",
                          "example": "320000.00",
                          "description": "4 小时卖出成交额（USD）。"
                        },
                        "volB24h": {
                          "type": "string",
                          "example": "1800000.00",
                          "description": "24 小时买入成交额（USD）。"
                        },
                        "volS24h": {
                          "type": "string",
                          "example": "1200000.00",
                          "description": "24 小时卖出成交额（USD）。"
                        },
                        "txs5m": {
                          "type": "integer",
                          "example": 150,
                          "description": "5 分钟总交易笔数。"
                        },
                        "txs1h": {
                          "type": "integer",
                          "example": 600,
                          "description": "1 小时总交易笔数。"
                        },
                        "txs4h": {
                          "type": "integer",
                          "example": 2100,
                          "description": "4 小时总交易笔数。"
                        },
                        "txs24h": {
                          "type": "integer",
                          "example": 8500,
                          "description": "24 小时总交易笔数。"
                        },
                        "txsB5m": {
                          "type": "integer",
                          "example": 90,
                          "description": "5 分钟买入笔数。"
                        },
                        "txsS5m": {
                          "type": "integer",
                          "example": 60,
                          "description": "5 分钟卖出笔数。"
                        },
                        "txsB1h": {
                          "type": "integer",
                          "example": 360,
                          "description": "1 小时买入笔数。"
                        },
                        "txsS1h": {
                          "type": "integer",
                          "example": 240,
                          "description": "1 小时卖出笔数。"
                        },
                        "txsB4h": {
                          "type": "integer",
                          "example": 1260,
                          "description": "4 小时买入笔数。"
                        },
                        "txsS4h": {
                          "type": "integer",
                          "example": 840,
                          "description": "4 小时卖出笔数。"
                        },
                        "txsB24h": {
                          "type": "integer",
                          "example": 5100,
                          "description": "24 小时买入笔数。"
                        },
                        "txsS24h": {
                          "type": "integer",
                          "example": 3400,
                          "description": "24 小时卖出笔数。"
                        },
                        "cs": {
                          "type": "string",
                          "example": "1000000000",
                          "description": "流通量。"
                        },
                        "mc": {
                          "type": "string",
                          "example": "12340.00",
                          "description": "市值（USD）。"
                        },
                        "liq": {
                          "type": "string",
                          "example": "50000.00",
                          "description": "流动性（USD）。"
                        },
                        "holders": {
                          "type": "integer",
                          "example": 3500,
                          "description": "持币地址数。"
                        },
                        "bnVol5m": {
                          "type": "string",
                          "example": "8000.00",
                          "description": "Binance MPC 钱包（经 Binance Web3 DEX 交易）5 分钟总成交额（USD）。"
                        },
                        "bnVol1h": {
                          "type": "string",
                          "example": "35000.00",
                          "description": "Binance MPC 钱包（经 Binance Web3 DEX 交易）1 小时总成交额（USD）。"
                        },
                        "bnVol4h": {
                          "type": "string",
                          "example": "120000.00",
                          "description": "Binance MPC 钱包（经 Binance Web3 DEX 交易）4 小时总成交额（USD）。"
                        },
                        "bnVol24h": {
                          "type": "string",
                          "example": "500000.00",
                          "description": "Binance MPC 钱包（经 Binance Web3 DEX 交易）24 小时总成交额（USD）。"
                        },
                        "bnVolB5m": {
                          "type": "string",
                          "example": "5000.00",
                          "description": "Binance MPC 钱包（经 Binance Web3 DEX 交易）5 分钟买入成交额（USD）。"
                        },
                        "bnVolS5m": {
                          "type": "string",
                          "example": "3000.00",
                          "description": "Binance MPC 钱包（经 Binance Web3 DEX 交易）5 分钟卖出成交额（USD）。"
                        },
                        "bnVolB1h": {
                          "type": "string",
                          "example": "21000.00",
                          "description": "Binance MPC 钱包（经 Binance Web3 DEX 交易）1 小时买入成交额（USD）。"
                        },
                        "bnVolS1h": {
                          "type": "string",
                          "example": "14000.00",
                          "description": "Binance MPC 钱包（经 Binance Web3 DEX 交易）1 小时卖出成交额（USD）。"
                        },
                        "bnVolB4h": {
                          "type": "string",
                          "example": "72000.00",
                          "description": "Binance MPC 钱包（经 Binance Web3 DEX 交易）4 小时买入成交额（USD）。"
                        },
                        "bnVolS4h": {
                          "type": "string",
                          "example": "48000.00",
                          "description": "Binance MPC 钱包（经 Binance Web3 DEX 交易）4 小时卖出成交额（USD）。"
                        },
                        "bnVolB24h": {
                          "type": "string",
                          "example": "300000.00",
                          "description": "Binance MPC 钱包（经 Binance Web3 DEX 交易）24 小时买入成交额（USD）。"
                        },
                        "bnVolS24h": {
                          "type": "string",
                          "example": "200000.00",
                          "description": "Binance MPC 钱包（经 Binance Web3 DEX 交易）24 小时卖出成交额（USD）。"
                        },
                        "bnTxs5m": {
                          "type": "integer",
                          "example": 25,
                          "description": "Binance MPC 钱包（经 Binance Web3 DEX 交易）5 分钟总交易笔数。"
                        },
                        "bnTxs1h": {
                          "type": "integer",
                          "example": 100,
                          "description": "Binance MPC 钱包（经 Binance Web3 DEX 交易）1 小时总交易笔数。"
                        },
                        "bnTxs4h": {
                          "type": "integer",
                          "example": 350,
                          "description": "Binance MPC 钱包（经 Binance Web3 DEX 交易）4 小时总交易笔数。"
                        },
                        "bnTxs24h": {
                          "type": "integer",
                          "example": 1200,
                          "description": "Binance MPC 钱包（经 Binance Web3 DEX 交易）24 小时总交易笔数。"
                        },
                        "bnTxsB5m": {
                          "type": "integer",
                          "example": 15,
                          "description": "Binance MPC 钱包（经 Binance Web3 DEX 交易）5 分钟买入笔数。"
                        },
                        "bnTxsS5m": {
                          "type": "integer",
                          "example": 10,
                          "description": "Binance MPC 钱包（经 Binance Web3 DEX 交易）5 分钟卖出笔数。"
                        },
                        "bnTxsB1h": {
                          "type": "integer",
                          "example": 60,
                          "description": "Binance MPC 钱包（经 Binance Web3 DEX 交易）1 小时买入笔数。"
                        },
                        "bnTxsS1h": {
                          "type": "integer",
                          "example": 40,
                          "description": "Binance MPC 钱包（经 Binance Web3 DEX 交易）1 小时卖出笔数。"
                        },
                        "bnTxsB4h": {
                          "type": "integer",
                          "example": 210,
                          "description": "Binance MPC 钱包（经 Binance Web3 DEX 交易）4 小时买入笔数。"
                        },
                        "bnTxsS4h": {
                          "type": "integer",
                          "example": 140,
                          "description": "Binance MPC 钱包（经 Binance Web3 DEX 交易）4 小时卖出笔数。"
                        },
                        "bnTxsB24h": {
                          "type": "integer",
                          "example": 720,
                          "description": "Binance MPC 钱包（经 Binance Web3 DEX 交易）24 小时买入笔数。"
                        },
                        "bnTxsS24h": {
                          "type": "integer",
                          "example": 480,
                          "description": "Binance MPC 钱包（经 Binance Web3 DEX 交易）24 小时卖出笔数。"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "stream": "w3w@onchainos@pub@tx-data@CT_501@C3DwDjT17gDvvCYC2nsdGHxDHVmQRdhKfpAdqQ29pump",
                  "data": {
                    "p": "0.00001234",
                    "t": 1700000000000,
                    "pc5m": "1.25",
                    "pc1h": "3.50",
                    "pc4h": "-2.10",
                    "pc24h": "12.80",
                    "vol5m": "50000.00",
                    "vol1h": "200000.00",
                    "vol4h": "800000.00",
                    "vol24h": "3000000.00",
                    "volB5m": "30000.00",
                    "volS5m": "20000.00",
                    "volB1h": "120000.00",
                    "volS1h": "80000.00",
                    "volB4h": "480000.00",
                    "volS4h": "320000.00",
                    "volB24h": "1800000.00",
                    "volS24h": "1200000.00",
                    "txs5m": 150,
                    "txs1h": 600,
                    "txs4h": 2100,
                    "txs24h": 8500,
                    "txsB5m": 90,
                    "txsS5m": 60,
                    "txsB1h": 360,
                    "txsS1h": 240,
                    "txsB4h": 1260,
                    "txsS4h": 840,
                    "txsB24h": 5100,
                    "txsS24h": 3400,
                    "cs": "1000000000",
                    "mc": "12340.00",
                    "liq": "50000.00",
                    "holders": 3500,
                    "bnVol5m": "8000.00",
                    "bnVol1h": "35000.00",
                    "bnVol4h": "120000.00",
                    "bnVol24h": "500000.00",
                    "bnVolB5m": "5000.00",
                    "bnVolS5m": "3000.00",
                    "bnVolB1h": "21000.00",
                    "bnVolS1h": "14000.00",
                    "bnVolB4h": "72000.00",
                    "bnVolS4h": "48000.00",
                    "bnVolB24h": "300000.00",
                    "bnVolS24h": "200000.00",
                    "bnTxs5m": 25,
                    "bnTxs1h": 100,
                    "bnTxs4h": 350,
                    "bnTxs24h": 1200,
                    "bnTxsB5m": 15,
                    "bnTxsS5m": 10,
                    "bnTxsB1h": 60,
                    "bnTxsS1h": 40,
                    "bnTxsB4h": 210,
                    "bnTxsS4h": 140,
                    "bnTxsB24h": 720,
                    "bnTxsS24h": 480
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w3w@onchainos@pub@tx@{chainId}@{contractAddress}": {
      "post": {
        "summary": "代币实时交易推送",
        "description": "代币交易历史实时推送，每次交易产生时触发推送。",
        "tags": ["Market"],
        "operationId": "realTimeTradesStream",
        "externalDocs": {
          "url": "https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/ws-streams/market#real-time-trades-stream"
        },
        "x-update-speed": "Real-time",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "e9d6b4349871b40611412680b3445fac"
            },
            "description": "唯一的 WebSocket 请求 ID。"
          },
          {
            "name": "chainId",
            "in": "path",
            "required": true,
            "description": "链唯一标识，如 \"1\"=Ethereum、\"56\"=BSC、\"CT_501\"=Solana。 支持链列表同 [「supported/chain」](/catalog/web3-wallet/api/rest-api/general-data#get-supported-chains) 接口。",
            "schema": {
              "type": "string",
              "example": "CT_501"
            }
          },
          {
            "name": "contractAddress",
            "in": "path",
            "required": true,
            "description": "代币合约地址。",
            "schema": {
              "type": "string",
              "example": "C3DwDjT17gDvvCYC2nsdGHxDHVmQRdhKfpAdqQ29pump"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "method": {
                    "type": "string",
                    "description": "WebSocket 数据流方法名称。",
                    "enum": ["SUBSCRIBE"],
                    "example": "SUBSCRIBE"
                  },
                  "params": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "要订阅的数据流列表。",
                    "example": [
                      "w3w@onchainos@pub@tx@ct_501@c3dwdjt17gdvvcyc2nsdghxdhvmqrdhkfpadqq29pump"
                    ]
                  },
                  "id": {
                    "type": "string",
                    "example": "e9d6b4349871b40611412680b3445fac",
                    "description": "唯一的 WebSocket 请求 ID。"
                  }
                },
                "required": ["method", "params", "id"],
                "additionalProperties": false
              },
              "example": {
                "method": "SUBSCRIBE",
                "params": [
                  "w3w@onchainos@pub@tx@ct_501@c3dwdjt17gdvvcyc2nsdghxdhvmqrdhkfpadqq29pump"
                ],
                "id": "e9d6b4349871b40611412680b3445fac"
              }
            }
          }
        },
        "responses": {
          "Successful Response": {
            "description": "实时交易记录推送响应。",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "stream": {
                      "type": "string",
                      "example": "w3w@onchainos@pub@tx@CT_501@C3DwDjT17gDvvCYC2nsdGHxDHVmQRdhKfpAdqQ29pump",
                      "description": "Stream 名称。"
                    },
                    "data": {
                      "type": "object",
                      "description": "实时交易记录推送事件数据。",
                      "properties": {
                        "tx": {
                          "type": "string",
                          "example": "3N8gti1ymmjWZnYStNZU5Q8c9yWjGDRVaHAB19uws5qZ",
                          "description": "交易哈希。"
                        },
                        "ua": {
                          "type": "string",
                          "example": "5hqZDJQidTDmjCrLLYi1NiwNUuCZYFc4vo9bPPMr3w85",
                          "description": "交易发起方钱包地址。"
                        },
                        "tp": {
                          "type": "string",
                          "example": "sell",
                          "description": "交易方向，相对查询代币而言。\"buy\"=买入，\"sell\"=卖出。"
                        },
                        "vol": {
                          "type": "string",
                          "example": "93.35",
                          "description": "成交金额（USD）。"
                        },
                        "t": {
                          "type": "integer",
                          "format": "int64",
                          "example": 1757489097000,
                          "description": "交易时间（毫秒时间戳）。"
                        },
                        "tokens": {
                          "type": "array",
                          "description": "交易代币对信息，固定 2 个元素，第一个是查询代币，第二个是配对代币。",
                          "example": [
                            {
                              "a": "4008134.67642",
                              "s": "PEPE",
                              "ca": "AL2wwYzJFDjxWuWFEyMbAMamBmMcpycoWpPwTS28pump"
                            },
                            {
                              "a": "0.424730224",
                              "s": "SOL",
                              "ca": "So11111111111111111111111111111111111111112"
                            }
                          ],
                          "items": {
                            "type": "object",
                            "properties": {
                              "a": {
                                "type": "string",
                                "example": "4008134.67642",
                                "description": "代币数量。"
                              },
                              "s": {
                                "type": "string",
                                "example": "PEPE",
                                "description": "代币 Symbol。"
                              },
                              "ca": {
                                "type": "string",
                                "example": "AL2wwYzJFDjxWuWFEyMbAMamBmMcpycoWpPwTS28pump",
                                "description": "代币合约地址。"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "stream": "w3w@onchainos@pub@tx@CT_501@C3DwDjT17gDvvCYC2nsdGHxDHVmQRdhKfpAdqQ29pump",
                  "data": {
                    "tx": "3N8gti1ymmjWZnYStNZU5Q8c9yWjGDRVaHAB19uws5qZ",
                    "ua": "5hqZDJQidTDmjCrLLYi1NiwNUuCZYFc4vo9bPPMr3w85",
                    "tp": "sell",
                    "vol": "93.35",
                    "t": 1757489097000,
                    "tokens": [
                      {
                        "a": "4008134.67642",
                        "s": "PEPE",
                        "ca": "AL2wwYzJFDjxWuWFEyMbAMamBmMcpycoWpPwTS28pump"
                      },
                      {
                        "a": "0.424730224",
                        "s": "SOL",
                        "ca": "So11111111111111111111111111111111111111112"
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w3w@onchainos@pub@candles@{bar}@{chainId}@{contractAddress}": {
      "post": {
        "summary": "代币K线推送",
        "description": "代币 K 线数据实时推送，当前未结束的 K 线会随新成交持续更新。",
        "tags": ["Market"],
        "operationId": "candlestickStream",
        "externalDocs": {
          "url": "https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/ws-streams/market#candlestick-stream"
        },
        "x-update-speed": "Real-time",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "e9d6b4349871b40611412680b3445fac"
            },
            "description": "唯一的 WebSocket 请求 ID。"
          },
          {
            "name": "bar",
            "in": "path",
            "required": true,
            "description": "K 线周期，枚举值：1s、5s、30s、1m、3m、5m、15m、30m、1h、2h、4h、6h、8h、12h、1d、3d、1w、1M。",
            "schema": {
              "type": "string",
              "example": "1s"
            }
          },
          {
            "name": "chainId",
            "in": "path",
            "required": true,
            "description": "链唯一标识，如 \"1\"=Ethereum、\"56\"=BSC、\"CT_501\"=Solana。 支持链列表同 [「supported/chain」](/catalog/web3-wallet/api/rest-api/general-data#get-supported-chains) 接口。",
            "schema": {
              "type": "string",
              "example": "CT_501"
            }
          },
          {
            "name": "contractAddress",
            "in": "path",
            "required": true,
            "description": "代币合约地址。",
            "schema": {
              "type": "string",
              "example": "C3DwDjT17gDvvCYC2nsdGHxDHVmQRdhKfpAdqQ29pump"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "method": {
                    "type": "string",
                    "description": "WebSocket 数据流方法名称。",
                    "enum": ["SUBSCRIBE"],
                    "example": "SUBSCRIBE"
                  },
                  "params": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "要订阅的数据流列表。",
                    "example": [
                      "w3w@onchainos@pub@candles@1s@ct_501@c3dwdjt17gdvvcyc2nsdghxdhvmqrdhkfpadqq29pump"
                    ]
                  },
                  "id": {
                    "type": "string",
                    "example": "e9d6b4349871b40611412680b3445fac",
                    "description": "唯一的 WebSocket 请求 ID。"
                  }
                },
                "required": ["method", "params", "id"],
                "additionalProperties": false
              },
              "example": {
                "method": "SUBSCRIBE",
                "params": [
                  "w3w@onchainos@pub@candles@1s@ct_501@c3dwdjt17gdvvcyc2nsdghxdhvmqrdhkfpadqq29pump"
                ],
                "id": "e9d6b4349871b40611412680b3445fac"
              }
            }
          }
        },
        "responses": {
          "Successful Response": {
            "description": "K线数据推送响应。",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "stream": {
                      "type": "string",
                      "example": "w3w@onchainos@pub@candles@1s@CT_501@C3DwDjT17gDvvCYC2nsdGHxDHVmQRdhKfpAdqQ29pump",
                      "description": "Stream 名称。"
                    },
                    "data": {
                      "type": "array",
                      "minItems": 6,
                      "maxItems": 6,
                      "description": "K 线数据为固定 6 元素的位置数组： [0]=开盘价, [1]=最高价, [2]=最低价, [3]=收盘价, [4]=交易额 (USD), [5]=开始时间(毫秒)。 收盘价 [3] 在该条 K 线未结束前会持续变动。",
                      "x-prefixItems": [
                        {
                          "type": "string",
                          "example": "0.00001234",
                          "description": "开盘价。"
                        },
                        {
                          "type": "string",
                          "example": "0.00001300",
                          "description": "最高价。"
                        },
                        {
                          "type": "string",
                          "example": "0.00001200",
                          "description": "最低价。"
                        },
                        {
                          "type": "string",
                          "example": "0.00001280",
                          "description": "收盘价，若该条 K 线数据未结束，收盘价会持续变动。"
                        },
                        {
                          "type": "string",
                          "example": "500000.00",
                          "description": "交易额，USD 计价。"
                        },
                        {
                          "type": "integer",
                          "format": "int64",
                          "example": 1700000000000,
                          "description": "该条 K 线数据开始时间戳，毫秒值，UTC+0。"
                        }
                      ],
                      "items": {
                        "oneOf": [
                          {
                            "type": "string",
                            "example": "0.00001234",
                            "description": "开盘价。"
                          },
                          {
                            "type": "string",
                            "example": "0.00001300",
                            "description": "最高价。"
                          },
                          {
                            "type": "string",
                            "example": "0.00001200",
                            "description": "最低价。"
                          },
                          {
                            "type": "string",
                            "example": "0.00001280",
                            "description": "收盘价，若该条 K 线数据未结束，收盘价会持续变动。"
                          },
                          {
                            "type": "string",
                            "example": "500000.00",
                            "description": "交易额，USD 计价。"
                          },
                          {
                            "type": "integer",
                            "format": "int64",
                            "example": 1700000000000,
                            "description": "该条 K 线数据开始时间戳，毫秒值，UTC+0。"
                          }
                        ]
                      },
                      "example": [
                        "0.00001234",
                        "0.00001300",
                        "0.00001200",
                        "0.00001280",
                        "500000.00",
                        1700000000000
                      ]
                    }
                  }
                },
                "example": {
                  "stream": "w3w@onchainos@pub@candles@1s@CT_501@C3DwDjT17gDvvCYC2nsdGHxDHVmQRdhKfpAdqQ29pump",
                  "data": [
                    "0.00001234",
                    "0.00001300",
                    "0.00001200",
                    "0.00001280",
                    "500000.00",
                    1700000000000
                  ]
                }
              }
            }
          }
        }
      }
    }
  }
}
