Token Prices

Live-streamed price updates for a token.

ℹ️

This endpoint is available on Codex Growth and Enterprise Plans

Endpoint: onPriceUpdated

Method: POST

Arguments

NameTypeDescription
addressString

The token contract address.

networkIdInt

The network ID the token is deployed on.

sourcePairAddressString

The pair contract address from which to get pricing

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 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"
      }
    }
  }
}

👋

Join our Discord

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