sagharkariFlow Net Staked, Circulating Supply and Ratio
    Updated 2023-05-11
    with staketable as (
    select sum (amount) as Staked_Volume
    from flow.core.ez_staking_actions
    where tx_succeeded = 'TRUE'
    and action in ('DelegatorTokensCommitted','TokensCommitted')),

    unstaketable as (
    select sum (amount) as UnStaked_Volume
    from flow.core.ez_staking_actions
    where tx_succeeded = 'TRUE'
    and action in ('DelegatorUnstakedTokensWithdrawn','UnstakedTokensWithdrawn'))

    select Staked_Volume - UnStaked_Volume as "Net Staked Volume",
    1036200000 as "FLOW Circulating Supply",
    ("Net Staked Volume" / 1036200000) * 100 as "Staked To Circulating Supply Ratio"
    from staketable t1 join unstaketable t2
    Run a query to Download Data