adriaparcerisasUser Behavior (redux) 2
Updated 2023-04-05
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
opt_txs as (
SELECT
trunc(block_timestamp,'day') as date,
'Optimism' as chain,
count(distinct tx_hash) as txs,count(distinct from_address) as active_users,
sum(tx_fee) as fees,avg(tx_fee) as avg_tx_fee
from optimism.core.fact_transactions group by 1
),
eth_txs as (
SELECT
trunc(block_timestamp,'day') as date,
'Ethereum' as chain,
count(distinct tx_hash) as txs,count(distinct from_address) as active_users,
sum(tx_fee) as fees,avg(tx_fee) as avg_tx_fee
from optimism.core.fact_transactions group by 1
),
opt_swaps as (
SELECT
trunc(x.block_timestamp,'day') as date,
'Optimism' as chain,
count(distinct x.tx_hash) as swaps,
count(distinct origin_from_address) as active_users,
sum(amount_in_usd) as volume,
avg(amount_in_usd) as avg_volume,
sum(tx_fee) as fees,
avg(tx_fee) as avg_tx_fee
from optimism.sushi.ez_swaps x
join optimism.core.fact_transactions y on x.tx_hash=y.tx_hash
group by 1
),
eth_swaps as (
SELECT
trunc(x.block_timestamp,'day') as date,
'Ethereum' as chain,
count(distinct x.tx_hash) as swaps,
Run a query to Download Data