rajsUntitled Query
Updated 2022-10-27Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
›
⌄
with pools as
(
SELECT
event_inputs:pool as pool,
event_inputs:token0 as token0,
event_inputs:token1 as token1
from ethereum.core.fact_event_logs
where event_name = 'PoolCreated'
and (event_inputs:token0 = '0x06450dee7fd2fb8e39061434babcfc05599a6fb8'
or event_inputs:token1 = '0x06450dee7fd2fb8e39061434babcfc05599a6fb8')
)
SELECT
*
-- contract_address,
-- sum(coalesce(amount_in_usd, amount_out_usd)) as volume,
-- count(distinct tx_hash) as no_of_txs
from ethereum.core.ez_dex_swaps
where contract_address IN
(
SELECT
pool
from pools
)
-- group by 1
-- order by 2 desc
limit 3
Run a query to Download Data