Madijailed/not jailed
    Updated 2022-12-19
    with df as (select
    date_trunc('week', BLOCK_TIMESTAMP) as date, tx_id,VALIDATOR_ADDRESS, AMOUNT/pow(10,decimal) as amount,label,
    replace(CURRENCY, 'gamm/pool/', '') as poolll,
    concat('pool #', poolll) as pool,
    DELEGATOR_SHARES,
    JAILED
    -- MISSED_BLOCKS,
    -- RAW_METADATA
    from osmosis.core.fact_superfluid_staking a left join osmosis.core.fact_validators b
    on a.VALIDATOR_ADDRESS = b.ADDRESS
    where poolll in ('1', '678', '704', '712', '674', '722', '9', '604', '497', '812', '584', '3', '481', '42', '463', '15')
    and tx_status = 'SUCCEEDED' and action = 'delegate')

    select date,
    case when JAILED = 'FALSE' then 'not jailed'
    else 'jailed' end as cat, count(DISTINCT VALIDATOR_ADDRESS) as count_validators,
    sum(amount) as sum_amount
    from df group by 1,2
    Run a query to Download Data