cybergenlabTVL_metric [Ecosystem]
    Updated 2024-11-18
    -- Scripts extracting all the latest TVL values from each network centric dashboard

    --Ethereum TVL
    --QueryID: 9a325dad-b646-4940-885f-6923cc52b54a
    with eth_tvl as (
    select
    value:DATE::date as date,
    'Ethereum' as network,
    value:TVL_LST::numeric as tvl,
    value:TVL_NO_LST::numeric as tvl_no_lst,
    row_number() over (partition by network order by date desc) as row_number
    from (
    select
    livequery.live.udf_api('https://flipsidecrypto.xyz/api/v1/queries/9a325dad-b646-4940-885f-6923cc52b54a/data/latest') as response
    ), lateral FLATTEN (input => response:data)
    order by 1 desc
    )

    --Arbitrum TVL
    --QueryID: c8e846bc-b75a-4013-aa4c-caa78d19f9ff
    , arb_tvl as (
    select
    value:DATE::date as date,
    'Arbitrum' as network,
    value:TVL::numeric as tvl,
    from (
    select
    livequery.live.udf_api('https://flipsidecrypto.xyz/api/v1/queries/c8e846bc-b75a-4013-aa4c-caa78d19f9ff/data/latest') as response
    ), lateral FLATTEN (input => response:data)
    order by 1 desc
    )

    --Optimism TVL
    --QueryID: 3ec8f136-c36a-41d6-8958-0c96185a110b
    , op_tvl as (
    select
    QueryRunArchived: QueryRun has been archived