rahoOP Delegation - Daily Change
Updated 2023-07-14
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 all_del as (
select
block_timestamp,
delegator,
delegation_type,
from_delegate,
to_delegate,
raw_new_balance/pow(10, 18) as new_bal,
raw_previous_balance/pow(10, 18) as old_bal,
new_bal - old_bal as net_change,
tx_hash
from optimism.core.fact_delegations
),
daily_amounts as (
select
date_trunc('day', block_timestamp) as date,
to_delegate,
sum(net_change) as daily_change
from all_del
group by 1, 2
),
daily_change as (
select
*
from daily_amounts
where daily_change != 0
order by date desc, daily_change desc
),
daily_type as (
select
date_trunc('day', block_timestamp) as date,
delegation_type,
sum(net_change) as daily_change
Run a query to Download Data