SELECT date_trunc('day', block_timestamp) as date,
    sum(Amount_in) as usdt_in,
    sum(amount_out) as usdt_out,
    platform,
    pool_id,
    count(trader) as users,
    address_name,
    project_name
    from near.core.ez_dex_swaps dx join near.core.dim_address_labels l
    on dx.platform = l.address
    where token_out_contract in ('usdt.tether-token.near')
    and label_type in 'dex'
    and block_timestamp::date >= '2023-05-01'
    group by 1, 4, 5, 7, 8
    order by 1


    SELECT *
    from near.core.dim_address_labels
    where address = 'v2.ref-finance.near'


    select distinct label_type
    from near.core.dim_address_labels


    select *
    from near.core.dim_address_labels
    where label_type = 'dex'
    Run a query to Download Data