elsinaCompare vol deposit and withdraw
    Updated 2025-02-07
    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
    TYPE
    DEP_VOLUME
    1
    deposit4256665.03144236
    2
    Withdraw3004756.22144775
    2
    60B
    5s