Soheil_MKUntitled Query
Updated 2022-10-22
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
28
29
30
31
32
33
34
35
36
›
⌄
With Op as (
SELECT
logs.BLOCK_TIMESTAMP::date as date,
sum(b.tx_fee) as tx_fee,
'OP' as network
FROM optimism.core.fact_event_logs logs
JOIN optimism.core.fact_token_transfers transfer
ON logs.tx_hash = transfer.tx_hash
JOIN optimism.core.fact_hourly_token_prices price
ON transfer.contract_address = price.token_address
AND date_trunc('hour', transfer.block_timestamp) = price.hour
join optimism.core.fact_transactions b
on logs.tx_hash = b.TX_HASH
WHERE logs.origin_to_address IN ('0xe592427a0aece92de3edee1f18e0157c05861564','0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45')
and logs.tx_status ='SUCCESS'
and logs.event_name = 'Swap'
and logs.BLOCK_TIMESTAMP >='2022-06-01'
group by 1
),
ETH as (
select
a.BLOCK_TIMESTAMP::date as date,
sum(b.tx_fee) as tx_fee,
'ETH' as network
from ethereum.uniswapv3.ez_swaps a
join ethereum.core.fact_transactions b
on a.TX_HASH = b.TX_HASH
where a.BLOCK_TIMESTAMP >='2022-06-01'
group by 1
)
Run a query to Download Data