mo115NEAR stablecoin swaps - Top
    Updated 2024-08-23
    with txs as ((select
    TX_HASH
    , TRADER
    , ((AMOUNT_OUT)-(AMOUNT_IN)) as diff
    , date_trunc('day', BLOCK_TIMESTAMP)as Date
    , '-' as type
    from near.defi.ez_dex_swaps
    where SYMBOL_OUT in ('USDt' , 'USDT.e' ,'USDC' ,'USDC.e')
    and SYMBOL_IN in ('USDt' , 'USDT.e' ,'USDC' ,'USDC.e')
    order by 3
    limit 100)

    UNION all

    (select
    TX_HASH
    , TRADER
    , ((AMOUNT_OUT)-(AMOUNT_IN)) as diff
    , date_trunc('day', BLOCK_TIMESTAMP)as Date
    , '+' as type
    from near.defi.ez_dex_swaps
    where SYMBOL_OUT in ('USDt' , 'USDT.e' ,'USDC' ,'USDC.e')
    and SYMBOL_IN in ('USDt' , 'USDT.e' ,'USDC' ,'USDC.e')
    order by 3 desc
    limit 100))
    select Date , count (distinct TX_HASH) as txs, sum (diff) as tot_diff, type
    from txs
    group by 1,4
    order by txs DESC


    QueryRunArchived: QueryRun has been archived