elsinadaily vol
    Updated 2025-02-07
    with dep as (
    SELECT
    tx_hash,
    event_name,
    contract_name
    from
    swell.core.ez_decoded_event_logs
    where
    event_name in ('Deposit', '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
    TOKEN_ADDRESS is NULL
    group by 1
    )

    select
    date_trunc('day', t.block_timestamp) as day,
    event_name,
    sum(value * usd_price) as volume
    from swell.core.fact_transactions t left join dep d on t.tx_hash = d.tx_hash left join eth_price on block_timestamp::date = date
    where
    contract_name in ('Wrapped Ether', 'tsSwellETH')
    group by 1, 2

    Last run: about 2 months ago
    DAY
    EVENT_NAME
    VOLUME
    1
    2025-01-06 00:00:00.000Deposit23983.12429135
    2
    2025-01-10 00:00:00.000Deposit17387.858437551
    3
    2025-01-12 00:00:00.000Withdrawal37.056573553
    4
    2025-01-06 00:00:00.000Withdrawal194.286361961
    5
    2025-01-29 00:00:00.000Withdrawal8381.717435813
    6
    2025-02-01 00:00:00.000Deposit48745.807707489
    7
    2025-01-05 00:00:00.000Withdrawal2906.905014083
    8
    2025-01-03 00:00:00.000Withdrawal3587.828400625
    9
    2025-01-07 00:00:00.000Withdrawal57.52366
    10
    2025-02-07 00:00:00.000Withdrawal17.70749512
    11
    2025-02-02 00:00:00.000Deposit18867.376531482
    12
    2025-02-05 00:00:00.000Withdrawal4546.813709375
    13
    2025-01-04 00:00:00.000Deposit13219.711494496
    14
    2025-01-22 00:00:00.000Deposit16288.891846954
    15
    2025-01-20 00:00:00.000Withdrawal5589.406008333
    16
    2025-01-24 00:00:00.000Deposit2859.047186329
    17
    2025-01-03 00:00:00.000Deposit6683.688743968
    18
    2025-02-04 00:00:00.000Deposit22783.507819644
    19
    2025-01-08 00:00:00.000Deposit55128.44404711
    20
    2025-01-20 00:00:00.000Deposit18920.675668273
    76
    4KB
    5s