stats for a token

Returns the latest address detail on Ethereum, where address is 0xc48b…b19a, quote currency is 0xc02a…6cc2 and base currency is 0xc48b…b19a: annotation, address, contract type, attributes name, attributes value, currency address, decimals and 10 more fields.

By gaurav · saved 21 July 2022 · Bitquery API v1

What it returns

Filters

The query

query MarketCap($contract: String!, $base: String!, $stable: String!, $pair: String!, $network: EthereumNetwork!) {
  ethereum(network: $network) {
    address(address: {is: $contract}) {
      annotation
      address
      smartContract {
        contractType
        attributes {
          name
          value
        }
        currency {
          address
          decimals
        }
      }
      balance
    }
    marketCapToken: dexTrades(
      options: {desc: ["block.height", "tradeIndex"], limit: 1}
      quoteCurrency: {is: $base}
      baseCurrency: {is: $contract}
      time: {since: "2022-01-20T14:54:20.313Z"}
    ) {
      tradeIndex
      block {
        height
      }
      baseCurrency {
        address
      }
      quoteCurrency {
        address
      }
      quotePrice
    }
    marketCapBase: dexTrades(
      baseCurrency: {is: $base}
      quoteCurrency: {is: $stable}
      options: {desc: ["block.height", "tradeIndex"], limit: 1}
      time: {since: "2022-01-20T14:54:20.313Z"}
    ) {
      tradeIndex
      block {
        height
      }
      baseCurrency {
        address
      }
      quoteCurrency {
        address
      }
      quotePrice
    }
    transfers(amount: {gt: 0}) {
      minted: amount(
        calculate: sum
        sender: {is: "0x0000000000000000000000000000000000000000"}
      )
      burned: amount(
        calculate: sum
        receiver: {is: "0x0000000000000000000000000000000000000000"}
      )
      currency(currency: {is: $contract}) {
        address
      }
    }
    twentyFourHourVolume: dexTrades(
      baseCurrency: {is: $contract}
      time: {since: "2022-01-20T14:54:20.313Z"}
    ) {
      twentyFourHourVolume: tradeAmount(in: USD)
    }
    totalTransactions: dexTrades(baseCurrency: {is: $contract}) {
      count
    }
    pooledBalances: address(address: {is: $pair}) {
      balances(currency: {in: [$base, $contract]}) {
        currency {
          address
          decimals
        }
        pooledBalance: value
      }
      address
    }
  }
}

Variables

{
  "options": {},
  "network": "ethereum",
  "contract": "0xc48b4814faed1ccc885dd6fde62a6474aecbb19a",
  "base": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "stable": "0xdac17f958d2ee523a2206206994597c13d831ec7",
  "pair": "0x185e32f3db8226a8363c31ca0453385f3f8dc126"
}

Similar queries