SocioCryptoETH derivates Swaps
    Updated 2022-09-12
    SELECT date_trunc('day', block_timestamp) as date,
    sum(CASE WHEN token_in = '0xe95a203b1a91a908f9b9ce46459d101078c2c3cb' THEN amount_in end) as "aETH swap in",
    sum(CASE WHEN token_out = '0xe95a203b1a91a908f9b9ce46459d101078c2c3cb' THEN amount_out end) as "aETH swap out",
    sum(CASE WHEN token_out = '0xe95a203b1a91a908f9b9ce46459d101078c2c3cb' OR token_in = '0xe95a203b1a91a908f9b9ce46459d101078c2c3cb' THEN 1 ELSE 0 end) as "aETH swap count",
    sum(CASE WHEN token_in = '0xae78736cd615f374d3085123a210448e74fc6393' THEN amount_in end) as "rETH swap in",
    sum(CASE WHEN token_out = '0xae78736cd615f374d3085123a210448e74fc6393' THEN amount_out end) as "rETH swap out",
    sum(CASE WHEN token_out = '0xae78736cd615f374d3085123a210448e74fc6393' OR token_in = '0xae78736cd615f374d3085123a210448e74fc6393' THEN 1 ELSE 0 end) as "rETH swap count",
    sum(CASE WHEN token_in = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84' THEN amount_in end) as "stETH swap in",
    sum(CASE WHEN token_out = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84' THEN amount_out end) as "stETH swap out",
    sum(CASE WHEN token_out = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84' OR token_in = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84' THEN 1 ELSE 0 end) as "stETH swap count"
    FROM ethereum.core.ez_dex_swaps
    WHERE token_in IN ('0xe95a203b1a91a908f9b9ce46459d101078c2c3cb', '0xae78736cd615f374d3085123a210448e74fc6393', '0xae7ab96520de3a18e5e111b5eaab095312d7fe84')
    OR token_out IN ('0xe95a203b1a91a908f9b9ce46459d101078c2c3cb', '0xae78736cd615f374d3085123a210448e74fc6393', '0xae7ab96520de3a18e5e111b5eaab095312d7fe84')
    GROUP BY date

    Run a query to Download Data