Mojtaba-BanaeiCosmos Staking Total Stats-1
    Updated 2024-06-22
    With
    Message_Types as (
    select
    msg_type,
    count(tx_id) as cnt,
    max(tx_id) as tx_id
    from
    cosmos.core.fact_msg_attributes
    WHERE
    block_timestamp > CURRENT_DATE - interval '20 days'
    -- attribute_key='module'
    -- attribute_value ilike '%wasm%'
    group by
    1
    order by
    2 desc
    ),
    redelegate_txs_source_validator as (
    select
    -- *
    tx_id,
    block_timestamp,
    attribute_value as source_validator,
    msg_index
    from
    cosmos.core.fact_msgs
    inner join cosmos.core.fact_msg_attributes using (tx_id, msg_index)
    where
    1 = 1
    -- and tx_id = 'FFFE2BD236DF63308984322BAA06AEA141983A9CBE4B9899FAE5C494F2F68A79'
    and msg_type = 'redelegate'
    and attribute_key = 'source_validator' -- amount/1e6 new_shares
    and tx_succeeded = TRUE
    and block_timestamp >= '{{start_date}}'::date
    and block_timestamp <= '{{end_date}}'::date
    -- LIMIT 10
    QueryRunArchived: QueryRun has been archived