Tokens Prices

Live-streamed price updates for many tokens.

ℹ️

This endpoint is available on Codex Growth and Enterprise Plans

Endpoint: onPricesUpdated

Method: POST

Arguments

NameTypeDescription
input[OnPricesUpdatedInput!]!

Required

NameTypeDescription
addressString!

Required
networkIdInt!

Required
sourcePairAddressString

Response

NameTypeDescription
addressString!The contract address of the token.
confidenceFloatRatio of how confident we are in the price
networkIdInt!The network ID the token is deployed on.
poolAddressString!The pool that emitted the swap generating this price
priceUsdFloat!The token price in USD.
timestampInt!The unix timestamp for the price.

Example

Query

subscription OnPricesUpdated($input: [OnPricesUpdatedInput!]!) {
  onPricesUpdated(input: $input) {
    address
    networkId
    priceUsd
  }
}

Response

{
  "id": "661144c5fd3a444ffdfs8b9518ddb8f94dec",
  "type": "data",
  "payload": {
  "data": {
    "onPricesUpdated": {
      "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
      "networkId": 1,
      "priceUsd": 2368.057616720742
    }
  }
}

👋

Join our Discord

Ask questions, share what you're working on and request new features 👬👭