SocioCryptoUSDT depeg Stat
    -- forked from USDT depeg @ https://flipsidecrypto.xyz/edit/queries/2a0f0cc1-ba7c-4f11-b6e2-ae1579cdab30

    SELECT 'flow_out' as title,
    count(DISTINCT trader) as n_trader,
    count(DISTINCT tx_id) as n_trades,
    sum(from_amount)/pow(10,6) as vol
    from osmosis.core.fact_swaps
    WHERE from_currency ilike '%8242AD24008032E457D2E12D46588FD39FB54FB29680C6C7663D296B383C37C4'
    AND block_timestamp >= '2023-06-15 02:00:00.000'
    AND block_timestamp <= '2023-06-15 18:00:00.000'
    AND tx_succeeded = ' true'
    GROUP BY 1
    UNION
    SELECT 'flow_in' as title,
    count(DISTINCT trader) as n_trader,
    count(DISTINCT tx_id) as n_trades,
    sum(to_amount)/pow(10,6) as vol
    from osmosis.core.fact_swaps
    WHERE to_currency ilike '%8242AD24008032E457D2E12D46588FD39FB54FB29680C6C7663D296B383C37C4'
    AND block_timestamp >= '2023-06-15 02:00:00.000'
    AND block_timestamp <= '2023-06-15 18:00:00.000'
    AND tx_succeeded = ' true'
    GROUP BY 1





    Run a query to Download Data