primo_dataeth_swap_usdc_weth
Updated 2022-07-09
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
›
⌄
select date(l.block_timestamp) as date
, count(l.tx_hash) as swap_count
, sum(((l.event_inputs:amount0Out::integer) + (l.event_inputs:amount0In::INTEGER))/ pow(10,t0.decimals)) as usdc_volume
from ethereum.core.fact_event_logs as l
left join ethereum.core.dim_dex_liquidity_pools as p
on l.contract_address = p.pool_address
left join ethereum.core.dim_contracts as t0
on p.token0 = t0.address
left join ethereum.core.dim_contracts as t1
on p.token1 = t1.address
where l.block_timestamp >= current_date - 6
and l.contract_address = lower('0x397FF1542f962076d0BFE58eA045FfA2d347ACa0')
and l.event_name = 'Swap'
group by 1
order by 1;
Run a query to Download Data