Updated 2022-08-11Copy Reference Fork
9
1
2
3
4
5
6
7
8
›
⌄
with outflow as (select date(block_timestamp) as out_date, count(DISTINCT(tx_hash)) as out_tx, count(DISTINCT(origin_from_address)) as out_user, sum(out_tx) over (order by out_date asc) as cum_out_tx from optimism.core.fact_event_logs
where origin_to_address = lower('0xc30141b657f4216252dc59af2e7cdb9d8792e1b0') and contract_address = lower('0xc30141b657f4216252dc59af2e7cdb9d8792e1b0')
and block_timestamp::date >= '2022-07-01' and block_timestamp::date < '2022-07-31' group by 1),
inflow as ( select date(block_timestamp) as date, count(DISTINCT(tx_hash)) as in_tx, count(DISTINCT(origin_from_address)) as in_user,
sum(in_tx) over (order by date asc) as cum_in_tx from ethereum.core.fact_event_logs where contract_address = lower('0x99c9fc46f92e8a1c0dec1b1747d010903e884be1')
and block_timestamp::date >= '2022-07-01' and block_timestamp::date < '2022-07-31' group by 1)
select date, out_tx as "outflows Transactions", in_tx as "inflows Transactions", out_user as "outflows Users" , in_user as "inflows Users" , cum_in_tx , cum_out_tx from outflow a left outer join inflow b on a.out_date = b.date
order by 1
Run a query to Download Data