Skip to main content

Returns

getDetailedPairStats
DetailedPairStats!
Stats for the pair with optional time windows (e.g. 5m, 1h, 24h). See DetailedPairStats.

Arguments

pairAddress
Address!
required
Pair contract address.
networkId
NetworkId!
required
Network ID (e.g. 1, 42161).
tokenOfInterest
TokenOfInterest
Which token to use for price (token0 or token1). See TokenOfInterest.
timestamp
Int
Optional timestamp for historical stats.
durations
[DetailedPairStatsDuration!]
Which time windows to return. See DetailedPairStatsDuration.
bucketCount
Int
Number of buckets per window.
statsType
TokenPairStatisticsType
FILTERED or UNFILTERED. See TokenPairStatisticsType.

Example

{
  getDetailedPairStats(
    pairAddress: "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640"
    networkId: 1
    tokenOfInterest: token0
    durations: [hour1]
  ) {
    pairAddress
    networkId
    tokenOfInterest
    statsType
    lastTransaction
    pair {
      token0
      token1
      token0Data {
        address
        name
        symbol
      }
      token1Data {
        address
        name
        symbol
      }
    }
    stats_hour1 {
      statsUsd {
        volume {
          currentValue
          previousValue
          change
        }
        buyVolume {
          currentValue
          previousValue
          change
        }
        sellVolume {
          currentValue
          previousValue
          change
        }
      }
      statsNonCurrency {
        transactions {
          currentValue
          previousValue
          change
        }
        buyers {
          currentValue
          previousValue
          change
        }
        sellers {
          currentValue
          previousValue
          change
        }
      }
    }
  }
}

Playground