Live-streamed price updates for a token.
This endpoint is available on Codex Growth and Enterprise Plans
Endpoint: onPriceUpdated
Method: POST
Arguments
Response
Name | Type | Description |
---|---|---|
address | String! | The contract address of the token. |
confidence | Float | Ratio of how confident we are in the price |
networkId | Int! | The network ID the token is deployed on. |
poolAddress | String! | The pool that emitted the swap generating this price |
priceUsd | Float! | The token price in USD. |
timestamp | Int! | The unix timestamp for the price. |
Example
Query
subscription OnPriceUpdated($address: String, $networkId: Int) {
onPriceUpdated(address: $address, networkId: $networkId) {
address
networkId
priceUsd
timestamp
}
}
Response
{
"id": "661144c5fd3a444ffdfs8b9518ddb8f94dec",
"type": "data",
"payload": {
"data": {
"onPriceUpdated": {
"address": "0x74ee86c1b4f0b400f5fbc606152497f21b11c508",
"networkId": 56,
"priceUsd": 0.08189245315757164,
"timestamp": 1657907058,
"__typename": "Price"
}
}
}
}
Ask questions, share what you're working on and request new features 👬👭