BlockTrackerpercentage of total supply staked
    Updated 2024-07-04
    with total_supply as (
    WITH json as (
    SELECT
    livequery.live.udf_api(
    'https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids=axelar&order=market_cap_desc&per_page=100&page=1&sparkline=false&locale=en'
    ) as resp
    )

    SELECT
    value:total_supply as "Total Supply"
    FROM json,
    LATERAL FLATTEN(input => json.resp:data) as value
    )
    ,
    total_staked as (
    select
    sum(case when action IN ('delegate') then amount/1e6 else 0 end)
    -sum(case when action IN ('undelegate') then amount/1e6 else 0 end) as "Total AXL Staked"
    from axelar.gov.fact_staking
    where tx_succeeded = TRUE
    )
    select
    100 * "Total AXL Staked" / "Total Supply" as "Percentage of Total Supply Staked"
    from total_staked
    join total_supply ON TRUE





    QueryRunArchived: QueryRun has been archived