get weth price

Returns the latest DEX trade by token on Ethereum, where currency smart contract is 0xC02a…6Cc2 and side currency smart contract is 0xA0b8…eB48: price in USD.

By Akshat · saved 4 August 2024 · run 1 time · Bitquery API v2

What it returns

Filters

The query

query MyQuery {
  EVM(network: eth, dataset: realtime) {
    DEXTradeByTokens(
      limit: {count: 1}
      orderBy: {descending: Block_Time}
      where: {Trade: {Currency: {SmartContract: {is: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"}}, Side: {Currency: {SmartContract: {is: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"}}}}, TransactionStatus: {Success: true}}
    ) {
      Trade {
        PriceInUSD
      }
    }
  }
}

Similar queries