Skip to Content

General Socket - Trade Events

This WebSocket allows you to receive a live update for every trade executed against your orders.

USE CASE

Receive each execution of your orders the moment it happens, with its price and quantity.

Details

  • Subscribe with the trades action on the raw socket, or OnTrades in the Python SDK (callback on_trades). Nothing is delivered until you subscribe.
  • Each message carries a tradeNumber (generated by the exchange) with the traded quantity and price. orderNumber is the id of the order the trade occurred for.
  • tradedQty, tradePrice and tradeValue describe that execution. Use id to sort trades.
  • exchangeOrderNo is the order number provided by the exchange.
  • orderDateTime is in IST as DD-MM-YYYY hh:mm:ss, which differs from the DD-MMM-YYYY format used in order events.
  • The raw socket message uses different key names. The SDK renames them, for example id_fill to tradeNumber, id to orderNumber, qty_traded to tradedQty and price_traded to tradePrice.

Response Attributes - For trade update

AttributeData TypeDescription
symbolstringEg: NSE:SBIN-EQ
idstringThe unique id to sort the trades
orderDateTimestringThe time when the trade occurred in “DD-MM-YYYY hh:mm:ss” format in IST
orderNumberstringThe order id for which the trade occurred
tradeNumberstringThe trade number generated by the exchange
tradePricefloatThe traded price
tradeValuefloatThe total traded value
tradedQtyintThe total traded qty
sideint
productTypestring
exchangeOrderNostringThe order number provided by the exchange
segmentint
exchangeint
fyTokenstringFytoken is a unique identifier for every symbol.
id_fyersstringFyers system-generated unique identifier for the order.
Last updated on