DatafiTest Case NEXO
    Updated 2023-01-30

    with nexo_binance_deposit as
    (SELECT
    'deposit' as type,
    block_timestamp::date as date,
    from_address as entity,
    symbol,
    sum(amount) as amount,
    sum(amount_usd) as usd_value
    from ethereum.core.ez_token_transfers
    where to_address = '0x9ec9bc7fb027448bb2670c4bd56043ea9dfd2dcc'
    -- and block_timestamp >= current_date -interval '30 days'
    group by 1,2,3,4
    union all
    SELECT
    'withdraw' as type,
    block_timestamp::date as date,
    to_address as entity,
    symbol,
    sum(amount) as amount,
    sum(amount_usd) as usd_value
    from ethereum.core.ez_token_transfers
    where from_address = '0x9ec9bc7fb027448bb2670c4bd56043ea9dfd2dcc'
    -- and block_timestamp >= current_date -interval '30 days'
    group by 1,2,3,4)

    select
    date,
    symbol,
    type,
    count(distinct entity) as no_wallet,
    sum(amount) as amount,
    sum(usd_value) as usd_value
    from nexo_binance_deposit
    where symbol = 'NEXO'
    AND date >= current_date - interval '60 days'
    Run a query to Download Data