Get Token price and liquidity

Returns the latest DEX trade on Ethereum and BNB Chain, where base currency is 0xbb4C…095c, quote currency is 0x6AE9…c39e and address is 0x18e2…E726: transaction hash, trade index, address address, contract type, currency name, block height, base currency symbol and 6 more fields.

By MuhammadUbaid · saved 25 October 2021 · run 36 times · Bitquery API v1

What it returns

Filters

The query

query($address : String!, $lp : String!){
  ethereum(network: bsc) {
    
    dexTrades(
      options: {desc: ["block.height","tradeIndex"], limit: 1}
      exchangeName: {in: ["Pancake", "Pancake v2"]}
      baseCurrency: {is: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"}
      quoteCurrency: {is: $address}
      date: {after: "2021-04-28"}
    ) {
      transaction {
        hash
      }
      tradeIndex
      smartContract {
        address {
          address
        }
        contractType
        currency {
          name
        }
      }
      tradeIndex
      block {
        height
      }
      baseCurrency {
        symbol
        address
      }
      quoteCurrency {
        symbol
        address
      }
      quotePrice
   
    }
    
    address(address: {is: $lp}) {
      balances(currency: {in: ["WBNB", "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"]}) {
        currency {
          symbol
        }
        value
      }
    }
  }
}

Variables

{
	"limit" : 10,
  "offset" : 0,
  "address": "0x6AE97E66EeC23B4fDF77Cd4cA423ECfBD439c39e",
  "lp" : "0x18e2758cC1e098760cceb32A90dBB272645AE726"
}

Similar queries