rezarwzDistribution of users based on the number of transactions
    Updated 2023-11-07
    with
    all_tx as (
    SELECT
    tx_hash,
    block_timestamp::date as date,
    ORIGIN_FROM_ADDRESS as wallet_address,
    case
    when AMOUNT_IN_USD is not null then AMOUNT_IN_USD
    when amount_out_usd is not null and AMOUNT_IN_USD is null then amount_out_usd
    end as amount_usd
    FROM
    ethereum.core.ez_dex_swaps
    WHERE
    ORIGIN_TO_ADDRESS = '0x881d40237659c251811cec9c364ef91dc08d300c'
    and event_name like '%Swap%'
    and BLOCK_NUMBER>=11042542
    UNION all
    SELECT
    tx_hash,
    block_timestamp::date as date,
    ORIGIN_FROM_ADDRESS as wallet_address,
    case
    when AMOUNT_IN_USD is not null then AMOUNT_IN_USD
    when amount_out_usd is not null and AMOUNT_IN_USD is null then amount_out_usd
    end as amount_usd
    FROM
    bsc.core.ez_dex_swaps
    WHERE
    ORIGIN_TO_ADDRESS = '0x1a1ec25dc08e98e5e93f1104b5e5cdd298707d31'
    and event_name like '%Swap%'
    and BLOCK_NUMBER>=16926510
    UNION all
    SELECT
    tx_hash,
    block_timestamp::date as date,
    ORIGIN_FROM_ADDRESS as wallet_address,
    Run a query to Download Data