Hessishast - dep ovr
    Updated 2025-03-16
    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: 23 days ago
    TIME
    TYPE
    TOKEN
    AMOUNT
    AMOUNT_USD
    TXS
    1
    2025-03-03 00:00:00.000depositsETH141.055843651329215.1116783291162
    2
    2025-01-21 00:00:00.000depositstETH62.056636434206746.493669195580
    3
    2025-03-17 00:00:00.000depositsETH111.798156761213975.290229106580
    4
    2025-02-03 00:00:00.000depositsSOL1208.735575332242977.507154123190
    5
    2025-03-23 00:00:00.000depositsUSDC438769.058693438708.801075606204
    6
    2025-02-08 00:00:00.000depositstETH7.13055542418990.971669301292
    7
    2025-01-31 00:00:00.000depositsUSDC174223.400511174221.607461837186
    8
    2025-01-11 00:00:00.000depositsUSDC338141.47594338132.768796995658
    9
    2025-03-26 00:00:00.000depositsUSDC680053.597564679954.734772254625
    10
    2025-02-24 00:00:00.000depositsUSDC1051222.8441731051138.4397388458
    11
    2024-12-21 00:00:00.000depositsUSDC182220.312857182232.703838274512
    12
    2025-03-23 00:00:00.000depositsETH106.247938915212580.522021336596
    13
    2025-01-18 00:00:00.000depositsSOL43.44988066210379.27128430558
    14
    2025-03-16 00:00:00.000depositsUSDC137187.047892137167.801692406177
    15
    2025-01-08 00:00:00.000depositsSOL13.5860917442673.68058563252
    16
    2025-01-23 00:00:00.000depositsETH272.102232209879766.9461024341335
    17
    2025-04-02 00:00:00.000depositsUSDC1371835.4685531371747.32812415628
    18
    2025-02-12 00:00:00.000depositstETH13.62388983436217.913356708125
    19
    2025-02-14 00:00:00.000depositstETH2.2447878686142.42800846160
    20
    2025-01-06 00:00:00.000depositsETH52.057214227190921.438274961710
    ...
    447
    34KB
    553s