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

Recent Trades

{{WSS_SERVER}}/ws
Last modified:2024-10-12 09:21:29
Recent Trades is used to subscribe to real-time updates on recent trades for a specific trading pair on our platform.

Information#

Update Speed: Real-time
Initial Limit: 20 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., order book updates).
1.
Type: String.
2.
Value: "trade"
3.
id: A unique identifier for the subscription request. Write randomly or use any unique identifier.
1.
Type: String.
2.
Example. "random string 001"
4.
symbol: Specifies the trading pair for which the subscriber wants to receive order book updates.
1.
Type: String.
2.
Example: "WBTCUSDT"

Subscribe Example#

Unsubscribe Example#

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 being updated (e.g., trade updates).
1.
Type: String
2.
Value: "trade"
4.
symbol: Specifies the trading pair for which the order book is being updated.
1.
Type: String
2.
Example: "WBTCUSDT"
5.
timestamp: The timestamp when the response was generated
1.
Type: Integer (UNIX timestamp in milliseconds)
2.
Examples: 1704696764925
6.
data: An array containing trade information for each recent trade.
1.
price: The price at which the trade occurred.
1.
Type: String
2.
quantity: The quantity of the asset traded.
1.
Type: String
3.
isBuyerMaker Indicates whether the buyer is the market maker.
1.
Type: Boolean
4.
buyerOrderId: The current timestamp when the update message is sent.
1.
Type: String
5.
sellerOrderId: The unique identifier of the seller's order.
1.
Type: String
6.
tradeTime: The timestamp when the trade occurred.
1.
Type: String (UNIX timestamp in milliseconds & UTC)

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 being updated (e.g., trade updates).
1.
Type: String
2.
Value: "trade"
3.
symbol: Specifies the trading pair for which the order book is being updated.
1.
Type: String
2.
Example: "WBTCUSDT"
4.
data: An array containing trade information for each recent trade.
1.
price: The price at which the trade occurred.
1.
Type: String
2.
quantity: The quantity of the asset traded.
1.
Type: String
3.
isBuyerMaker Indicates whether the buyer is the market maker.
1.
Type: Boolean
4.
buyerOrderId: The current timestamp when the update message is sent.
1.
Type: String
5.
sellerOrderId: The unique identifier of the seller's order.
1.
Type: String
6.
tradeTime: The timestamp when the trade occurred.
1.
Type: String (UNIX timestamp in milliseconds & UTC)

Response Example#

{
  "type": "update",
  "channel": "trade",
  "symbol": "WBTCUSDT",
  "data": [
    {
      "price": "35566.14",
      "quantity": "0.02",
      "isBuyerMaker": false,
      "buyerOrderID": "178523",
      "sellerOrderID": "9563",
      "tradeTime": "1700822401238"
    },
    {
      "price": "35576.47",
      "quantity": "0.01",
      "isBuyerMaker": false,
      "buyerOrderID": "178523",
      "sellerOrderID": "9562",
      "tradeTime": "1700822401238"
    }
  ]
}

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
K Line
Next
24hr Ticker Statistics
Built with