BlockTrackerliquid staking growth by protocol
    Updated 2025-03-03
    -- forked from liquid staking @ https://flipsidecrypto.xyz/edit/queries/83455bbc-b444-43b0-bf37-81411e8c4d95

    WITH
    liquid_staking as (
    SELECT
    'Linear' as protocol,
    TO_TIMESTAMP(value:date::string) as date,
    value:totalLiquidityUSD::int as tvl
    FROM
    (
    SELECT defillama.get('/protocol/linear-protocol', {}) as resp),
    LATERAL FLATTEN(input => resp:data:tvl)
    union all
    SELECT
    'Meta Pool' as protocol,
    TO_TIMESTAMP(value:date::string) as date,
    value:totalLiquidityUSD::int as tvl
    FROM
    (
    SELECT defillama.get('/protocol/Meta-pool', {}) as resp),
    LATERAL FLATTEN(input => resp:data:tvl)
    union all
    SELECT
    'Here Wallet Staking' as protocol,
    TO_TIMESTAMP(value:date::string) as date,
    value:totalLiquidityUSD::int as tvl
    FROM
    (
    SELECT defillama.get('/protocol/Here-wallet-staking', {}) as resp),
    LATERAL FLATTEN(input => resp:data:tvl)
    )
    ,
    near_price as (
    select
    date_trunc('day', hour) as day,
    avg(price) as price_usd
    QueryRunArchived: QueryRun has been archived