POST
https://prv.gateway.indexer.biya.io
/
injective_spot_exchange_rpc.InjectiveSpotExchangeRPC
/
StreamTradesV2
StreamTradesV2
curl --request POST \
  --url https://prv.gateway.indexer.biya.io/injective_spot_exchange_rpc.InjectiveSpotExchangeRPC/StreamTradesV2 \
  --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 (V2). Same functionality as StreamTrades but with improved performance and additional fields.
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 StreamTradesV2Response objects with the same structure as StreamTrades but with performance improvements.

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/StreamTradesV2
Using websocat:
echo '{"market_id": "0x...", "subaccount_id": "0x..."}' | \
  websocat ws://localhost:8088/injective_spot_exchange_rpc.InjectiveSpotExchangeRPC/StreamTradesV2
Using wscat:
wscat -c ws://localhost:8088/injective_spot_exchange_rpc.InjectiveSpotExchangeRPC/StreamTradesV2
# Then send: {"market_id": "0x...", "subaccount_id": "0x..."}