Token Price in USDT V2

This API provides the latest USDT token price in USD for Ethereum blockchain using DEXs like Uniswap, Balancer. You can also get the price of USDT Token at any previous date or time. You can also specify a specific exchange to get the price from using the filter.

By Nikhil · saved 10 July 2023 · run 16 times · Bitquery API v2

What it returns

Filters

The query

#this query retrieves trade information for a token and tx hash ordered in descending order of block time 
query ($token: String!) {
  EVM(dataset: combined, network: eth) {
    DEXTrades(
      limit: {count: 1}
      where: {Trade: {Buy: {Currency: {SmartContract: {is: $token}}}, Sell: {Currency: {SmartContract: {is: "0xdac17f958d2ee523a2206206994597c13d831ec7"}}}}}
      orderBy: {descending: Block_Time}
    ) {
      Block {
        Time
      }
      Transaction {
        Hash
      }
      Trade {
        Buy {
          Amount
          Seller
          Price
          Currency {
            Name
          }
          Buyer
        }
        Dex {
          ProtocolName
        }
        Sell {
          Amount
          Buyer
          Seller
          Price
          Currency {
            Name
            SmartContract
          }
        }
      }
    }
  }
}

Variables

{
  "network": "eth",
  "token": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
}

Similar queries