trades-query

Returns the latest 100 DEX trades by token on Ethereum, where side currency smart contract is 0xC02a…6Cc2, currency smart contract is 0x6982…1933 and block time before 2025-05-14: block time, sum of trade side amount in USD, quantile of trade price in USD, price in USD and trade price.

By Sebastian · saved 15 May 2025 · run 18 times · Bitquery API v2

What it returns

Filters

The query

query EVMTokenHistoricalData {
    EVM(network: eth) {
        DEXTradeByTokens(
            orderBy: { descendingByField: "Block_Time" }
            where: {
                Trade: {
                    Side: {
                        Currency: { SmartContract: { is: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" } }
                        AmountInUSD: { ge: "0.5" }
                    }
                    Currency: { SmartContract: { is: "0x6982508145454Ce325dDbE47a25d4ec3d2311933" } }
                    Success: true
                    PriceAsymmetry: { le: 0.1 }
                }
                TransactionStatus: { Success: true }
                Block: { Time: { before: "2025-05-14T07:00:00.000Z" } }
            }
            limit: { count: 100 }
        ) {
            Block {
                Time(interval: { in: minutes, count: 1 })
            }
            volume: sum(of: Trade_Side_AmountInUSD)
            high: quantile(of: Trade_PriceInUSD, level: 0.90)
            low: quantile(of: Trade_PriceInUSD, level: 0.10)
            Trade {
                open: PriceInUSD(minimum: Block_Number)
                openNative: Price(minimum: Block_Number)
                close: PriceInUSD(maximum: Block_Number)
                closeNative: Price(maximum: Block_Number)
            }
        }
    }
}

Similar queries