Afonso_DiazTotal
Updated 2024-09-03
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
pricet as (
select
hour::date as date,
avg(price) as price_usd
from
flow.price.ez_prices_hourly
where
symbol = 'FLOW'
group by 1
),
main as (
select
tx_id,
block_timestamp,
iff(event_type = 'Stake', event_data:flowAmountIn, event_data:lockedFlowAmount)::float as amount,
amount * price_usd as amount_usd,
event_type as action,
authorizers[0] as staker
from
flow.core.fact_events events
join
flow.core.fact_transactions using(tx_id)
left join
pricet on block_timestamp::date = date
where
event_contract = 'A.d6f80565193ad727.LiquidStaking'
and event_type in ( 'Stake', 'Unstake')
and tx_succeeded = 1
)
select
count(distinct tx_id) as transactions,
QueryRunArchived: QueryRun has been archived