MLDZMNstk2
    Updated 2024-01-04
    select
    date_trunc('month',BLOCK_TIMESTAMP) as date,
    'Stake' as action,
    count(distinct tx_hash) as no_action,
    count(distinct ORIGIN_FROM_ADDRESS) as no_users,
    sum(DECODED_LOG:amount/1e18) as volume,
    avg(DECODED_LOG:amount/1e18) as avg_volume,
    sum(volume) over (order by date) as cum_volume
    from avalanche.core.ez_decoded_event_logs
    where EVENT_NAME='StakeToken'
    and DECODED_LOG:token='0xb27c8941a7df8958a1778c0259f76d1f8b711c35'
    and CONTRACT_ADDRESS='0x53a893498313d05f023efd86a7aea0fd783c7bc2'
    group by 1

    union all


    select
    date_trunc('month',BLOCK_TIMESTAMP) as date,
    'Unstake' as action,
    count(distinct tx_hash) as no_action,
    count(distinct ORIGIN_FROM_ADDRESS) as no_users,
    sum(DECODED_LOG:amount/1e18) as volume,
    avg(DECODED_LOG:amount/1e18) as avg_volume,
    sum(volume) over (order by date) as cum_volume
    from avalanche.core.ez_decoded_event_logs
    where EVENT_NAME='UnstakeToken'
    and DECODED_LOG:token='0xb27c8941a7df8958a1778c0259f76d1f8b711c35'
    and CONTRACT_ADDRESS='0x53a893498313d05f023efd86a7aea0fd783c7bc2'
    group by 1


    QueryRunArchived: QueryRun has been archived