0xallyzachnative stake vs lst
    Updated 2025-03-24
    WITH total_stake AS (
    -- Compute total stake per epoch (this is the combined value)
    SELECT
    epoch,
    ROUND(SUM(active_stake) * POW(10,-9), 0) AS total_stake
    FROM solana.gov.fact_validators
    WHERE active_stake > 0
    GROUP BY 1
    ),

    latest_epoch AS (
    -- Get the most recent epoch
    SELECT MAX(epoch) AS latest_epoch FROM total_stake
    ),

    historical_epochs AS (
    -- Determine the epochs closest to 1d, 7d, and 30d ago (assuming ~1 epoch = 2 days)
    SELECT
    le.latest_epoch AS current_epoch,
    le.latest_epoch - 1 AS epoch_1d_ago, -- 1 epoch ~ 2 days
    le.latest_epoch - 4 AS epoch_7d_ago, -- 7 days ≈ 4 epochs
    le.latest_epoch - 15 AS epoch_30d_ago -- 30 days ≈ 15 epochs
    FROM latest_epoch le
    ),

    staked_changes AS (
    -- Get stake amounts for the latest and historical epochs
    SELECT
    ns.epoch,
    ns.total_stake,
    he.current_epoch,
    he.epoch_1d_ago,
    he.epoch_7d_ago,
    he.epoch_30d_ago
    FROM total_stake ns
    JOIN historical_epochs he
    Last run: about 1 month ago
    STAKE_TYPE
    ROW_NUM
    SHARE
    CURRENT_VALUE
    CHANGE_24H
    CHANGE_24H_PCT
    CHANGE_7D
    CHANGE_7D_PCT
    CHANGE_30D
    CHANGE_30D_PCT
    1
    Total Stake11003846394407709070.226239760.691981840.05
    2
    2
    3
    Native Stake388.613408189226544870.1917775910.52-2451036-0.71
    4
    LST Supply411.39438205181164200.26638217268463851.9695210626492206.434628307
    4
    290B
    2s