POST
https://prv.gateway.indexer.biya.io
/
injective_spot_exchange_rpc.InjectiveSpotExchangeRPC
/
StreamTrades
StreamTrades
curl --request POST \
  --url https://prv.gateway.indexer.biya.io/injective_spot_exchange_rpc.InjectiveSpotExchangeRPC/StreamTrades \
  --header 'Content-Type: application/json' \
  --data '
{
  "market_id": "<string>",
  "subaccount_id": "<string>",
  "execution_side": "<string>",
  "direction": "<string>",
  "subaccount_ids": [
    {}
  ]
}
'
Stream newly executed trades from Spot Market. This endpoint sends real-time updates whenever a trade is executed.
This is a streaming endpoint that requires WebSocket or Server-Sent Events support. The connection will remain open and receive updates in real-time.
market_id
string
Market ID (optional)
subaccount_id
string
Subaccount ID (optional)
execution_side
string
Execution side (optional)
direction
string
Trade direction (optional)
subaccount_ids
array
Array of subaccount IDs (optional)

Response

The response is a stream of StreamTradesResponse objects:
{
  "trade": {
    "order_hash": "string",
    "subaccount_id": "string",
    "market_id": "string",
    "trade_execution_type": "string",
    "trade_direction": "string",
    "price": {
      "price": "string",
      "quantity": "string",
      "timestamp": "number"
    },
    "fee": "string",
    "executed_at": "number",
    "fee_recipient": "string",
    "trade_id": "string",
    "execution_side": "string",
    "cid": "string"
  },
  "operation_type": "string",
  "timestamp": "number"
}

cURL Example

gRPC-Web streaming endpoints require WebSocket support. Standard curl cannot handle streaming responses.
Using grpcurl:
grpcurl -plaintext -d '{
  "market_id": "0x...",
  "subaccount_id": "0x..."
}' \
  localhost:8088 \
  injective_spot_exchange_rpc.InjectiveSpotExchangeRPC/StreamTrades
Using websocat:
echo '{"market_id": "0x...", "subaccount_id": "0x..."}' | \
  websocat ws://localhost:8088/injective_spot_exchange_rpc.InjectiveSpotExchangeRPC/StreamTrades
Using wscat:
wscat -c ws://localhost:8088/injective_spot_exchange_rpc.InjectiveSpotExchangeRPC/StreamTrades
# Then send: {"market_id": "0x...", "subaccount_id": "0x..."}