tkvresearchnecessary-lavender
    Updated 2025-04-01
    with contract as
    (select address,
    symbol,
    name
    from ink.core.dim_contracts),

    ink_wallet as
    (select
    user_add
    from
    (select date(block_timestamp) as datetime,
    date_trunc('week',block_timestamp) as week_date,
    date_trunc('month',block_timestamp) as month_date,
    tx_hash,
    tx_fee,
    to_address as user_add,
    from_address as contract_add
    from ink.core.fact_transactions
    where from_address in (select address from contract)
    union all
    select date(block_timestamp) as datetime,
    date_trunc('week',block_timestamp) as week_date,
    date_trunc('month',block_timestamp) as month_date,
    tx_hash,
    tx_fee,
    from_address as user_add,
    to_address as contract_add
    from ink.core.fact_transactions
    where to_address in (select address from contract)))

    select sum(total_buy) as total_vol,
    chain
    from
    (select *,
    'Base' as chain
    from
    Last run: 27 days ago
    TOTAL_VOL
    CHAIN
    1
    4380281.48Base
    2
    495542.58Arbitrum
    3
    167475.78Optimism
    4
    30386.02Blast
    4
    86B
    17s