no data with amount usd

Returns 20 DEX trades by token on Polygon, where block time since 2025-05-04, sorted by USD, highest first: block time, trade amount, currency symbol, currency name, smart contract, protocol name, side amount and 8 more fields.

By Nadia · saved 5 May 2025 · run 4 times · Bitquery API v2

What it returns

Filters

The query

query pairs($min_count: String, $network: evm_network, $time_1h_ago: DateTime, $time_ago: DateTime, $wmatic: String!, $weth: String!, $usdc: String!, $usdt: String!, $usdcpos: String!) {
  EVM(network: $network) {
    DEXTradeByTokens(
      where: {Block: {Time: {since: $time_ago}}, any: [{Trade: {Side: {Currency: {SmartContract: {is: $usdt}}}}}, {Trade: {Side: {Currency: {SmartContract: {is: $usdc}}}, Currency: {SmartContract: {notIn: [$usdt]}}}}, {Trade: {Side: {Currency: {SmartContract: {is: $usdcpos}}}, Currency: {SmartContract: {notIn: [$usdt, $usdc]}}}}, {Trade: {Side: {Currency: {SmartContract: {is: $weth}}}, Currency: {SmartContract: {notIn: [$usdc, $usdt, $usdcpos]}}}}, {Trade: {Side: {Currency: {SmartContract: {is: $wmatic}}}, Currency: {SmartContract: {notIn: [$weth, $usdc, $usdt, $usdcpos]}}}}, {Trade: {Side: {Currency: {SmartContract: {notIn: [$usdc, $usdt, $weth, $wmatic]}}}, Currency: {SmartContract: {notIn: [$usdc, $usdt, $weth, $wmatic, $usdcpos]}}}}]}
      orderBy: {descendingByField: "usd"}
      limit: {count: 20}
    ) {
      Block {
        Time(maximum: Block_Time, selectWhere: {after: $time_1h_ago})
      }
      Trade {
        Amount
        Currency {
          Symbol
          Name
          SmartContract
          ProtocolName
        }
        Side {
          Amount
          AmountInUSD
          Currency {
            Symbol
            Name
            SmartContract
            ProtocolName
          }
        }
        price_last: PriceInUSD(maximum: Block_Number)
        price_1h_ago: PriceInUSD(
          maximum: Block_Number
          if: {Block: {Time: {before: $time_1h_ago}}}
        )
      }
      usd: sum(of: Trade_Side_AmountInUSD)
      count(selectWhere: {ge: $min_count})
    }
  }
}

Variables

{
  "network": "matic",
  "time_1h_ago": "2025-05-05T09:54:39Z",
  "time_ago": "2025-05-04T10:54:39Z",
  "min_count": "100",
  "usdc": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
  "usdcpos": "0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
  "usdt": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
  "weth": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
  "wmatic": "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270"
}

Similar queries