Pool balance

Returns one address detail on Ethereum and BNB Chain, where address is 0xf65c…d713, base currency is 0xbb4c…095c and quote currency is 0x55d3…7955, sorted by block height transaction index, highest first: currency symbol, currency address, balances value, block height, timestamp time, transaction index and quote price.

By Casor · saved 4 February 2022 · run 4 times · Bitquery API v1

What it returns

Filters

The query

query ($network: EthereumNetwork, $address: String!, $base: String!, $target: String!, $quote: String!) {
  ethereum(network: $network) {
    address(address: {is: $address}) {
      balances(currency: {in: [$base, $target]}) {
        currency {
          symbol
          address
        }
        value
      }
    }
    base: dexTrades(
      baseCurrency: {is: $base}
      quoteCurrency: {is: $quote}
      options: {desc: ["block.height", "transaction.index"], limit: 1}
    ) {
      block {
        height
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
      }
      transaction {
        index
      }
      quotePrice
    }
    target: dexTrades(
      baseCurrency: {is: $target}
      quoteCurrency: {is: $quote}
      options: {desc: ["block.height", "transaction.index"], limit: 1}
    ) {
      block {
        height
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
      }
      transaction {
        index
      }
      quotePrice
    }
  }
}

Variables

{
  "network": "bsc",
  "address": "0xf65c1c0478efde3c19b49ecbe7acc57bb6b1d713",
  "base": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
  "target": "0x603c7f932ed1fc6575303d8fb018fdcbb0f39a95",
  "quote": "0x55d398326f99059ff775485246999027b3197955"
}

Similar queries