SocioCryptoCrosschain swaps
    Updated 2023-01-17
    SELECT 'solana' as chain,
    date_trunc('day',block_timestamp) as date,
    count(DISTINCT tx_id) as n_swaps,
    COUNT(DISTINCT swapper) as n_swappers
    FROM solana.core.fact_swaps
    WHERE succeeded = 'TRUE'
    AND date between'2022-05-26' and '2022-12-31'
    GROUP BY date
    UNION
    SELECT 'ethereum' as chain,
    date_trunc('day',block_timestamp) as date,
    count(DISTINCT tx_hash) as n_swaps,
    COUNT(DISTINCT origin_from_address) as n_swappers
    FROM ethereum.core.ez_dex_swaps
    WHERE date between'2022-05-26' and '2022-12-31'
    GROUP BY date
    UNION
    SELECT 'near' as chain,
    date_trunc('day',block_timestamp) as date,
    COUNT(DISTINCT tx_hash) AS n_swaps,
    COUNT(DISTINCT trader) AS n_swappers
    FROM near.core.ez_dex_swaps
    WHERE date between'2022-05-26' and '2022-12-31'
    GROUP BY date
    UNION
    SELECT 'flow' as chain,
    date_trunc('day',block_timestamp) as date,
    count(DISTINCT tx_id) as n_swaps,
    COUNT(DISTINCT trader) as n_swappers
    FROM flow.core.ez_swaps
    WHERE date between'2022-05-26' and '2022-12-31'
    GROUP BY date
    UNION
    SELECT 'thorchain' as chain,
    date_trunc('day',block_timestamp) as date,
    count(DISTINCT tx_id) as n_swaps,
    Run a query to Download Data