Skip to main content
This topic listens for trades of a given pair (BASE_QUOTE), so it will be notified every time a trade happens.

Subscription Request

method
string
required
Subscribe method. Must be subscribe
topics
array
required
Array of topics to subscribe to. Format: trade@BASE_QUOTEExample: ["trade@ETH_BRL", "trade@BTC_BRL"]

Stream Response

id
integer
Each WebSocket message includes a sequential numeric id. Each topic has its own unique sequence, and for private topics, the sequence is unique to each topic and user. It’s important to note that some topics will send a “welcome message”, which will have an id value of -1. Additionally, this sequence may be reset between connections, so be sure to update this value locally whenever you reconnect.
topic
string
Topic name (format: trade@BASE_QUOTE)
timestamp
integer
Timestamp in milliseconds
body
object
Trade details object

Subscription Example

{
  "method": "subscribe",
  "topics": [
    "trade@ETH_BRL"
  ]
}

Stream Response Example

{
  "id": 1,
  "topic": "trade@ETH_BRL",
  "timestamp": 1672856503549,
  "body": {
    "amount": 0.2404764,
    "date": "2019-01-03T02:27:33.947Z",
    "id": "2B222F22-5235-45FA-97FC-E9DBFA2575EE",
    "maker_order_id": "F49F5BD8-3F5B-4364-BCEE-F36F62DB966A",
    "maker_side": "buy",
    "maker_type": "limit",
    "pair": "ETH_BRL",
    "price": 15160,
    "taker_order_id": "FEAB5CEC-7F9E-4F95-B67D-9E8D5C739BE3",
    "taker_side": "sell",
    "taker_type": "market",
    "timestamp": 1675780847920,
    "total_value": 3638.4
  }
}

Multiple Subscriptions Example

{
  "method": "subscribe",
  "topics": [
    "trade@ETH_BRL",
    "trade@BTC_BRL",
    "trade@BTC_USD"
  ]
}

Usage Notes

  • Real-time Updates: You will receive a notification every time a trade executes on the specified pair
  • Multiple Pairs: You can subscribe to multiple trading pairs in a single request
  • Maker vs Taker: The response includes information about both sides of the trade:
    • Maker: The order that was already in the order book
    • Taker: The incoming order that matched with the maker
  • Volume Information: Use the amount and price fields to calculate trade volume and values

Use Cases

  • Trade Feed: Display a real-time feed of all trades for specific pairs
  • Market Activity: Monitor market activity and trading volume
  • Order Matching: Track when your orders have been executed and matched
  • Analytics: Collect trade data for analysis and reporting