This page outlines how to use the gRPC endpoint for asset price streaming.
Streaming is the real-time alternative to repeatedly polling the REST price endpoints. For a single price poll, use Get Current Prices for All Supported Assets or Get Current Price for an Asset.
Authentication
All requests must include your API key in the x-api-key metadata header.
Request
RPC: ondo.gm.backend.v1.BackendService/StreamPriceUpdates
Asset symbols to subscribe to. If empty, you will receive updates for all assets.
Response
A server stream of messages. Each message batches one or more price updates into a single updates array.
Array of price updates.
Unix timestamp of the price update (in nanoseconds).
grpcurl \
-H "x-api-key: <YOUR_API_KEY>" \
-d '{"symbols": ["AAPLon", "GOOGLon"]}' \
grpc.gm.ondo.finance:443 \
ondo.gm.backend.v1.BackendService/StreamPriceUpdates
{
"updates": [
{
"ticker": "GOOGL",
"symbol": "GOOGLon",
"stock_price": "304.915",
"token_price": "305.39957516982939159",
"timestamp": "1773350214478735649"
},
{
"ticker": "AAPL",
"symbol": "AAPLon",
"stock_price": "256.2475",
"token_price": "256.791808070580506978",
"timestamp": "1773350214476688119"
}
]
}