Hessishast - tvl
    Updated 2 days ago
    WITH all_events AS (
    SELECT
    tx_id,
    CASE
    WHEN value ILIKE '%LendingAccountDeposit%' THEN 'deposit'
    WHEN value ILIKE '%LendingAccountBorrow%' THEN 'borrow'
    WHEN value ILIKE '%LendingAccountWithdraw%' THEN 'withdraw'
    WHEN value ILIKE '%LendingAccountRepay%' THEN 'repay'
    END AS action
    FROM eclipse.core.fact_transactions,
    TABLE(FLATTEN(input => LOG_MESSAGES))
    WHERE tx_id IN (
    SELECT DISTINCT tx_id
    FROM eclipse.core.fact_events_inner
    WHERE INSTRUCTION_PROGRAM_ID = 'Astro1oWvtB7cBTwi3efLMFB47WXx7DJDQeoxi235kA'
    )
    AND (value ILIKE '%LendingAccountDeposit%'
    OR value ILIKE '%LendingAccountBorrow%'
    OR value ILIKE '%LendingAccountWithdraw%'
    OR value ILIKE '%LendingAccountRepay%')
    ),


    prices as
    ( SELECT date_trunc('day',hour) as day, avg(close) as pr, case
    when ASSET_ID = 'ethereum' then 'ETH'
    when ASSET_ID = 'usd-coin' then 'USDC'
    when ASSET_ID = 'solana' then 'SOL'
    when ASSET_ID = 'turbo-eth' then 'tETH'
    when ASSET_ID = 'celestia' then 'TIA'
    end as Eclipse_cr
    from crosschain.price.fact_prices_ohlc_hourly
    where hour::date >= '2024-10-01' and
    ASSET_ID in ('ethereum', 'solana', 'usd-coin','turbo-eth','celestia')
    and PROVIDER = 'coingecko'
    GROUP by all ),
    Last run: 1 day ago
    TIME
    TVL
    1
    2025-04-25 00:00:00.00017959470.5746799
    2
    2025-04-24 00:00:00.00018012831.2022241
    3
    2025-04-23 00:00:00.00018049494.5291951
    4
    2025-04-22 00:00:00.00017986784.822832
    5
    2025-04-21 00:00:00.00018080669.4504695
    6
    2025-04-20 00:00:00.00018439367.0141983
    7
    2025-04-19 00:00:00.00018544131.7665128
    8
    2025-04-18 00:00:00.00018594766.0765048
    9
    2025-04-17 00:00:00.00018611705.3662652
    10
    2025-04-16 00:00:00.00018713560.9946358
    11
    2025-04-15 00:00:00.00018870681.6646493
    12
    2025-04-14 00:00:00.00019044904.9376517
    13
    2025-04-13 00:00:00.00019076907.3668807
    14
    2025-04-12 00:00:00.00019730066.5428233
    15
    2025-04-11 00:00:00.00021718839.397425
    16
    2025-04-10 00:00:00.00021764987.0078988
    17
    2025-04-09 00:00:00.00021948535.5288247
    18
    2025-04-08 00:00:00.00022203447.5765429
    19
    2025-04-07 00:00:00.00022399890.6150257
    20
    2025-04-06 00:00:00.00022800788.5157675
    ...
    141
    6KB
    557s