alitaslimiStablecoins Swaps of SushiSwap
    Updated 2022-06-08
    SELECT
    dex,
    token,
    SUM(txn) AS txn,
    ROUND(SUM(volume)) AS volume,
    SUM(amount) AS amount,
    AVG(price) AS price,
    AVG(price_min) AS price_min,
    AVG(price_max) AS price_max
    FROM (
    SELECT
    platform AS dex,
    symbol_in AS token,
    COUNT(DISTINCT tx_hash) AS txn,
    SUM(amount_in_usd) AS volume,
    SUM(amount_in) AS amount,
    AVG(amount_in_usd / amount_in) AS price,
    MIN(amount_in_usd / amount_in) AS price_min,
    MAX(amount_in_usd / amount_in) AS price_max
    FROM
    ethereum.core.ez_dex_swaps
    WHERE
    symbol_in IS NOT NULL AND amount_in_usd > 0
    GROUP BY
    platform,
    token
    UNION ALL
    SELECT
    platform AS dex,
    symbol_out AS token,
    COUNT(DISTINCT tx_hash) AS txn,
    SUM(amount_out_usd) AS volume,
    SUM(amount_out) AS amount,
    AVG(amount_out_usd / amount_out) AS price,
    MIN(amount_out_usd / amount_out) AS price_min,
    MAX(amount_out_usd / amount_out) AS price_max
    Run a query to Download Data