Query editor
/* This checks for all transactions where the contract was directly called. We filter for the "swap" functionby taking the 4 byte function signature from the "data" column*/SELECT * FROM ethereum.transactionsWHERE to = 0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc --USDC/WETH uniswap v2 pair contractAND substr(data,1,10) = 0x022c0d9f --swap() function signatureLIMIT 10/* This checks for all transactions where the contract was called either at any level.This means at the top level (like in transactions table) or by any underlying executions whereanother contract calls this one. */SELECT * FROM ethereum.tracesWHERE to = 0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc --USDC/WETH uniswap v2 pair contractAND substr(input,1,10) = 0x022c0d9f --swap() function signatureLIMIT 10/* This looks for all transactions where the specific "swap" function was called atany level (it's a subset of traces, and can be joined by `call_trace_address`).All the columns are decoded from the "input" column of traces table. */SELECT * FROM uniswap_v2_ethereum.Pair_call_swapWHERE contract_address = 0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc --USDC/WETH uniswap v2 pair contractLIMIT 10/* This gets us all the events emitted by the contract, where topic1 is the event signature.This is known as topic0 is most docs and on explorers like etherscan. */SELECT * FROM ethereum.logsWHERE contract_address = 0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc --USDC/WETH uniswap v2 pair contractAND topic1 = 0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822 --Swap() event signatureLIMIT 10/* This looks for all "Swap" events emitted by the contract. This is a decoded version of the logs table. */SELECT * FROM uniswap_v2_ethereum.Pair_evt_SwapWHERE contract_address = 0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc --USDC/WETH uniswap v2 pair contractLIMIT 10/* This looks for all swaps in the aggreagted dex.trades table. The values are created using a combination of the tablesabove as well as other tables such as prices.usd and tokens.erc20 */SELECT * FROM dex.tradesWHERE project_contract_address = 0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc --USDC/WETH uniswap v2 pair contractLIMIT 10