Eman-RazStake-to-Supply Ratio
    Updated 2 days ago
    WITH TABLE1 AS (with tab1 as (SELECT count(distinct tx_hash) as "Staking Txns Count",
    count(distinct origin_from_address) as "Stakers Count", sum(amount) as "Staking Volume (avUSD)",
    median(amount) as "Median Staking Volume"
    FROM avalanche.core.ez_token_transfers
    WHERE origin_function_signature='0x6e553f65'
    and origin_from_address=from_address
    and origin_to_address=to_address
    and origin_to_address='0x06d47f3fb376649c3a9dafe069b3d6e35572219e'
    and contract_address='0x24de8771bc5ddb3362db529fc3358f2df3a0e346'),

    tab2 as (SELECT count(distinct tx_hash) as "Unstaking Txns Count",
    count(distinct origin_from_address) as "Unstakers Count", sum(amount) as "Unstaking Volume (avUSD)",
    median(amount) as "Median Unstaking Volume"
    FROM avalanche.core.ez_token_transfers
    WHERE origin_function_signature='0xf2888dbb'
    and origin_to_address='0x06d47f3fb376649c3a9dafe069b3d6e35572219e'
    and contract_address='0x24de8771bc5ddb3362db529fc3358f2df3a0e346'
    and from_address='0xf2af724f421b072d5c07c68a472ef391ef47bcbd'
    and to_address=origin_from_address)

    select "Staking Txns Count", "Unstaking Txns Count",
    round((("Staking Txns Count"/("Staking Txns Count"+"Unstaking Txns Count"))*100),2) as "Staking Txn Ratio",
    "Stakers Count", "Unstakers Count", "Staking Volume (avUSD)", "Unstaking Volume (avUSD)",
    "Staking Volume (avUSD)"-"Unstaking Volume (avUSD)" as "Net Volume (avUSD)"
    from tab1 , tab2),

    Table2 as (with holders_tab as (
    SELECT
    t.address as address,
    SUM(t.amount) as net_amount
    FROM (
    SELECT from_address AS address, -amount AS amount
    FROM avalanche.core.ez_token_transfers
    WHERE contract_address = '0x24de8771bc5ddb3362db529fc3358f2df3a0e346'
    UNION ALL
    SELECT to_address AS address, amount
    Last run: 2 days ago
    Stake-to-Supply Ratio
    1
    85.26
    1
    9B
    11s