tkvresearcheth action vs gas
    Updated 2024-11-19
    with swap_volume as (

    select date_trunc('day', block_timestamp) as day, sum(amount_in_usd) as swap_volume, count(*) as swap_txn
    from ethereum.defi.ez_dex_swaps
    where block_timestamp >= current_timestamp() - INTERVAL '3 month'
    group by 1
    )

    , gas_price_swap as (
    select
    date_trunc('day', block_timestamp) as day,
    avg(GAS_PRICE) as gas_price_swap
    from ethereum.core.fact_transactions
    where block_timestamp >= current_timestamp() - INTERVAL '3 month'
    and tx_hash IN (select tx_hash from ethereum.defi.ez_dex_swaps where block_timestamp >= current_timestamp() - INTERVAL '3 month' )
    group by 1

    )

    , bridge_activity as(

    select date_trunc('day', block_timestamp) as day, sum(amount_usd) as bridge_volume, count(*) as bridge_txn
    from ethereum.defi.ez_bridge_activity
    where block_timestamp >= current_timestamp() - INTERVAL '3 month'
    group by 1

    )

    , gas_price_bridge as (
    select
    date_trunc('day', block_timestamp) as day,
    avg(GAS_PRICE) as gas_price_bridge
    from ethereum.core.fact_transactions
    where block_timestamp >= current_timestamp() - INTERVAL '3 month'
    and tx_hash IN (select tx_hash from ethereum.defi.ez_bridge_activity where block_timestamp >= current_timestamp() - INTERVAL '3 month' )
    group by 1
    QueryRunArchived: QueryRun has been archived