Vessel Finance API
  1. Market
Vessel Finance API
  • Introduction
  • General Info
  • HMAC Signature Guide
  • Poseidon Signature Guide
  • Internal Transfer Signature Guide
  • Error Code
  • Vessel REST API
    • Public
      • Market Data
        • 24hr Ticker Statistics
        • Kline / Candlestick Data
        • Order Book
        • Recent Trades List
        • Average Price
        • AMM Pool Last 24h Data
      • Exchange Data
        • Ticker Info
        • Asset Info
        • Trade Fee
        • AMM Pool Info
    • User
      • Asset
        • User Asset
        • Withdraw
        • Withdraw History
        • Deposit History
        • Claim History
        • Internal Transfer (Send)
        • Internal Transfer History
      • Order
        • Place Order
        • Cancel Order
        • Open Orders
        • Completed Orders
        • All Orders
        • Query Order
        • Modify Order
      • AMM
        • Add Liquidity
        • Remove Liquidity
        • Collect Fee
        • AMM Position
        • AMM Action History
      • Account
        • User Profile
        • User Trade List
  • Vessel WebSocket
    • Market
      • Order Book
      • K Line
      • Recent Trades
      • 24hr Ticker Statistics
      • Ticker Setting Upade
    • User
      • Authorize
      • Balance
      • Account
  1. Market

K Line

{{WSS_SERVER}}/ws
Last modified:2024-10-12 09:19:19
K Line is used to subscribe to real-time updates for the candlestick (Kline) data of a specific trading pair on our platform.

Information#

Update Speed: 2000ms
Initial Limit: 50 data points

Message Structure#

Send Message#

1.
type: Specifies the type of WebSocket message.
1.
Type: String
2.
Value: "subscribe"
2.
channel: Indicates the type of data to subscribe to (e.g., Kline updates).
1.
Type: String
2.
Value: "kline"
3.
id: A unique identifier for the subscription request.
1.
Type: String
2.
Value: A randomly generated string or any unique identifier.
4.
symbol: Specifies the trading pair for which the subscriber wants to receive Kline updates.
1.
Type: String
2.
Example: "WBTCUSDT"
5.
interval: The time interval for each candlestick in the Kline data.
1.
Type: String
2.
Examples: "1m", "5m", "15m", "30m", "1h", "4h", "1h".

Subscribe Example#

{
    "type": "subscribe",
    "channel": "kline",
    "id": "random string",    
    "symbol": "WBTCUSDT",
    "interval": "1m"
}

Unsubscribe Example#

{
    "type": "unsubscribe",
    "channel": "kline",
    "id": "random string",    
    "symbol": "WBTCUSDT",
    "interval": "1m"
}

Initial Message#

1.
id: A unique identifier for the message, used to match responses to specific requests.
1.
Type: String
2.
Value: "random string"
2.
type: Specifies the type of WebSocket message.
1.
Type: String
2.
Value: "init"
3.
channel: Indicates the type of data to subscribe to (e.g., Kline updates).
1.
Type: String
2.
Value: "kline"
4.
symbol: Specifies the trading pair for which the subscriber wants to receive Kline updates.
1.
Type: String
2.
Example: "WBTCUSDT"
5.
interval: The time interval for each candlestick in the Kline data.
1.
Type: String
2.
Examples: "1m", "5m", "15m", "30m", "1h", "4h", "1h".
6.
timestamp: The timestamp when the response was generated.
1.
Type: String (UNIX timestamp in milliseconds)
2.
Examples: 1704696764925
7.
data: Contains the actual Kline update information.
1.
openTime: The opening time of the candlestick.
1.
Type: String (UNIX timestamp in milliseconds)
2.
openPrice: The opening price of the candlestick.
1.
Type: String
3.
highPrice: The highest price reached during the candlestick's duration.
1.
Type: String
4.
lowPrice: The lowest price reached during the candlestick's duration.
1.
Type: String
5.
closePrice: The closing price of the candlestick.
1.
Type: String
6.
volume: The total traded volume during the candlestick's duration.
1.
Type: String
7.
trades: The number of trades executed during the candlestick's duration.
1.
Type: String
8.
closeTime: The closing time of the candlestick.
1.
Type: String (UNIX timestamp in milliseconds & UTC)
9.
quoteVolume: The total quoted volume during the candlestick's duration.
1.
Type: String
10.
takerBuyBaseVolume: The volume of the asset bought by takers during the candlestick's duration.
1.
Type: String
11.
takerBuyQuoteVolume: The quoted volume of the asset bought by takers during the candlestick's duration.
1.
Type: String

Response Example#

Update Message#

1.
Type: Specifies the type of WebSocket message.
1.
Type: String
2.
Value: "update"
2.
Channel: Indicates the type of data to subscribe to (e.g., Kline updates).
1.
Type: String
2.
Value: "kline"
3.
Symbol: Specifies the trading pair for which the subscriber wants to receive Kline updates.
1.
Type: String
2.
Example: "WBTCUSDT"
4.
Interval: The time interval for each candlestick in the Kline data.
1.
Type: String
2.
Examples: "1m", "5m", "15m", "30m", "1h", "4h", "1h".
5.
Data: Contains the actual Kline update information.
1.
Open Time: The opening time of the candlestick.
1.
Type: String (UNIX timestamp in milliseconds & UTC)
2.
Open Price: The opening price of the candlestick.
1.
Type: String
3.
High Price: The highest price reached during the candlestick's duration.
1.
Type: String
4.
Low Price: The lowest price reached during the candlestick's duration.
1.
Type: String
5.
Close Price: The closing price of the candlestick.
1.
Type: String
6.
Volume: The total traded volume during the candlestick's duration.
1.
Type: String
7.
Trades: The number of trades executed during the candlestick's duration.
1.
Type: String
8.
Close Time: The closing time of the candlestick.
1.
Type: String (UNIX timestamp in milliseconds)
9.
Quote Volume: The total quoted volume during the candlestick's duration.
1.
Type: String
10.
Taker Buy Base Volume: The volume of the asset bought by takers during the candlestick's duration.
1.
Type: String
11.
Taker Buy Quote Volume: The quoted volume of the asset bought by takers during the candlestick's duration.
1.
Type: String

Update Example#

{
  "type": "update",
  "channel": "kline",
  "symbol": "WBTCUSDT",
  "interval": "1m",
  "data": {
    "openTime": "1700813460000",
    "openPrice": "33749.79000000",
    "highPrice": "33749.79000000",
    "lowPrice": "33749.79000000",
    "closePrice": "33749.79000000",
    "volume": "0.00000000",
    "trades": "0",
    "closeTime": "1700813519999",
    "quoteVolume": "0.00000000",
    "takerBuyBaseVolume": "0.00000000",
    "takerBuyQuoteVolume": "0.00000000"
  }
}

Request

Header Params
VESSEL-API-KEY
string 
required
Default:
{{API_KEY}}
VESSEL-PASSPHRASE
string 
required
Default:
{{API_PASSPHRASE}}
VESSEL-SIGNATURE
string 
required
Use signRequest script to generate
VESSEL-TIMESTAMP
string 
required
Use signRequest script to set
Previous
Order Book
Next
Recent Trades
Built with