Token Price in USDT Subscription

this retrieves token price in USDT in realtime. Change address of token to get trades for any currency

By Divyasshree N · saved 7 July 2023 · run 5 times · Bitquery API v2

What it returns

Filters

The subscription

#this retrieves token price in USDT in realtime. Change address of token to get trades for any currency
subscription ($token: String!, $network: evm_network!) {
  EVM(network: $network) {
    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