ETH pairs

Returns 100 DEX trades by token on Ethereum, where block time after 2024-09-24, sorted by USD, highest first: currency symbol, currency name, smart contract, protocol name, side currency symbol, side currency name, side smart contract and 8 more fields.

By Aleksey · saved 24 September 2024 · Bitquery API v2

What it returns

Filters

The query

query pairs($min_count: String, 
  $network: evm_network, $time_10min_ago: DateTime, $time_1h_ago: DateTime, $time_3h_ago: DateTime,
  $eth: String!, $weth: String!, $usdc: String!, $usdt: String!
) {
  EVM(network: $network) {
    DEXTradeByTokens(
      where: {
        Block: {Time: {after: $time_3h_ago}}, 
				any: [
          {Trade: {Side: {Currency: {SmartContract: {is: $eth}}}}},
          {Trade: {Side: {Currency: {SmartContract: {is: $weth} }} Currency: {SmartContract: {notIn: [$eth]} } }}
          {Trade: {Side: {Currency: {SmartContract: {is: $usdt} }} Currency: {SmartContract: {notIn: [$eth, $weth]} } }}
          {Trade: {Side: {Currency: {SmartContract: {is: $usdc} }} Currency: {SmartContract: {notIn: [$eth, $weth, $usdt]} } }}
          {Trade: {Side: {Currency: {SmartContract: {notIn: [$usdc, $usdt, $weth, $eth]} }} 
            						  Currency: {SmartContract: {notIn: [$usdc, $usdt, $weth, $eth]}} }}
        ]
      }
      orderBy: {descendingByField: "usd"}
      limit: {count: 100}
    ) {
      Trade {
        Currency {
          Symbol
          Name
          SmartContract
          ProtocolName
        }
        Side {
          Currency {
            Symbol
            Name
            SmartContract
            ProtocolName
          }
        }
        price_last: PriceInUSD(maximum: Block_Number)
        price_10min_ago: PriceInUSD(
          maximum: Block_Number
          if: {Block: {Time: {before: $time_10min_ago}}}
        )
        price_1h_ago: PriceInUSD(
          maximum: Block_Number
          if: {Block: {Time: {before: $time_1h_ago}}}
        )
        price_3h_ago: PriceInUSD(minimum: Block_Number)
      }
      dexes: uniq(of: Trade_Dex_OwnerAddress)
      amount: sum(of: Trade_Side_Amount)
      usd: sum(of: Trade_Side_AmountInUSD)
      sellers: uniq(of: Trade_Seller)
      buyers: uniq(of: Trade_Buyer)
      count(selectWhere: {ge: $min_count})
    }
  }
}

Variables

{
  "network": "eth",
  "time_10min_ago": "2024-09-24T06:46:32Z",
  "time_1h_ago": "2024-09-24T05:56:32Z",
  "time_3h_ago": "2024-09-24T03:56:32Z",
  "usdc": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  "usdt": "0xdac17f958d2ee523a2206206994597c13d831ec7",
  "weth": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "eth": "0x",
  "min_count": "10"
}

Similar queries