Updated 2024-12-28
    with

    main as (
    select
    tx_id,
    block_timestamp,
    trader as user,
    nvl(amount_in_usd, amount_out_usd) as amount_usd,
    token_in_symbol as symbol_in,
    token_out_symbol as symbol_out
    from flow.defi.ez_dex_swaps
    where block_timestamp::date between '{{ start_date }}' and '{{ end_date }}'
    and amount_usd <= 1e6
    )

    select
    count(distinct tx_id) as transactions,
    count(distinct user) as users,
    sum(amount_usd) as total_volume_usd,
    avg(amount_usd) as average_amount_usd,
    transactions / count(distinct block_timestamp::date) as daily_average_transactions,
    users / count(distinct block_timestamp::date) as daily_average_users

    from main






    QueryRunArchived: QueryRun has been archived