elsinatotal vol
    Updated 2025-02-08
    with dep as (
    SELECT
    tx_hash,
    event_name,
    contract_name
    from
    swell.core.ez_decoded_event_logs
    where
    event_name = 'Deposit' and
    block_timestamp::date >= '2025-01-01'
    ),

    withdraw as (
    SELECT
    block_timestamp,
    tx_hash,
    event_name,
    contract_name,
    REGEXP_REPLACE(SUBSTRING(Data, 3), '^0+', '') AS cleaned_data,
    livequery.utils.udf_hex_to_int(cleaned_data)/pow(10,18) as amount
    from
    swell.core.ez_decoded_event_logs
    where
    event_name = 'Withdrawal' and
    block_timestamp::date >= '2025-01-01'
    ),

    eth_price as (
    select
    date_trunc('day', hour) as date,
    avg(PRICE) usd_price
    from crosschain.price.ez_prices_hourly
    where
    symbol ='ETH' and
    BLOCKCHAIN = 'ethereum' and
    date >= '2025-01-01' and
    Last run: about 2 months ago
    DEPOSIT_VOL
    WITHDRAW_VOL
    VOLUME
    1
    4256668.490876243004736.921531567261405.41240781
    1
    54B
    19s