mz0111wallet 2
    Updated 2023-03-17
    select
    date_trunc(day,t1.block_timestamp) as date,
    payer,
    case when payer ='0xecfad18ba9582d4f' then 'JoyRide'
    when payer= '0x1b65c33d7a352c61' then 'Cricket Moments'
    when payer ='0x18eb4ee6b3c026d2' then 'Dapper'
    when payer = '0x4bbff461fa8f6192' then 'Fantastec'
    when payer ='0x55ad22f01ef568a1' then 'Blocto'
    end as Payer_Name,
    count (distinct t1.tx_id) as TX_Count,
    sum(EVENT_DATA:amount) as Fee,
    count (distinct proposer) as Users_Count,
    sum (tx_count) over (partition by payer_name order by date) as Cum_TX_Count,
    sum (Users_Count) over (partition by payer_name order by date) as Cum_Users_Count,
    sum (Fee) over (partition by payer_name order by date) as Cum_Fee
    from flow.core.fact_transactions t1
    join flow.core.fact_events t2 on t1.tx_id = t2.tx_id
    where EVENT_TYPE='TokensWithdrawn'
    and payer in ('0xecfad18ba9582d4f' , '0x18eb4ee6b3c026d2' , '0x55ad22f01ef568a1' ,
    '0x1b65c33d7a352c61' , '0x4bbff461fa8f6192' )
    and t1.TX_SUCCEEDED ilike 'true'
    and date >= current_date - {{period}}
    group by 1,2,3
    order by 1
    Run a query to Download Data