mo115NEAR stablecoin swaps-Total
    Updated 2024-08-23
    -- forked from NEAR stablecoin swaps @ https://flipsidecrypto.xyz/studio/queries/17f3209b-a6bf-43e2-97d4-a16664e71541
    with txs as (
    select ---date_trunc('day', BLOCK_TIMESTAMP)as "Date"
    TX_HASH
    , TRADER
    , AMOUNT_IN
    , AMOUNT_OUT
    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')
    )
    SELECT
    count (distinct TX_HASH) as "Transactions"
    , count (distinct TRADER) as "Wallets"
    , sum(AMOUNT_IN) as "Amount Swapped From"
    , sum(AMOUNT_OUT) as "Amount Swapped To"
    , (sum(AMOUNT_OUT)-sum(AMOUNT_IN)) as diff
    from txs
    QueryRunArchived: QueryRun has been archived