mlhDaily average volume of $Atom redelagations
    Updated 2022-12-12
    select date,
    case when date between '2022-10-30' and '2022-11-14' then 'Proposal 82'
    when date < '2022-10-30' then 'Before Proposal 82'
    else 'After Proposal 82' end as period,
    count(DISTINCT(tx_from)) as redelegators,
    count(DISTINCT(tx_id)) as redelagations,
    sum(redelegate_amount) as redelegate_size,
    avg(redelegate_amount) as avg_redelegate_size
    from (select date,
    tx_from,
    tx_id,
    amount/pow(10,6) as redelegate_amount
    from (select date(a.block_timestamp) as date,
    tx_from,
    b.tx_id,
    replace(ATTRIBUTE_VALUE,'uatom','' ) as amount
    from cosmos.core.fact_msg_attributes a join cosmos.core.fact_transactions b on a.tx_id = b.tx_id
    where MSG_TYPE = 'redelegate'
    and ATTRIBUTE_KEY = 'amount'
    )
    )
    where date >= '2022-09-01'
    group by 1,2
    Run a query to Download Data