Sbhn_NPcombative-maroon
    Updated 2024-09-13
    with base as (select
    DISTINCT EVENT_DATA:initiator as lockers,
    SUM(CAST(EVENT_DATA:amount as DECIMAL)) as flow,
    from flow.core.fact_events
    where event_contract = 'A.a45ead1cf1ca9eda.FlowRewards'
    and event_type = 'Locked'
    and tx_succeeded
    group by 1)

    select case when flow<100 then 'Less Than 100 $FLOW'
    when flow>=100 and flow<1000 then '100 - 1000 $FLOW'
    when flow>=1000 and flow<10000 then '1000 - 10000 $FLOW'
    else 'More Than 10000 $FLOW' end as splitter,
    count(DISTINCT lockers) as users
    from base
    group by 1
    QueryRunArchived: QueryRun has been archived