rajsUntitled Query
    Updated 2022-09-16
    SELECT
    -- *
    origin_from_address,
    sum(case when token_out = '0x8790f2fc7ca2e7db841307fb3f4e72a03baf7b47' then amount_out / pow(10,18) end) as tokens_bought,
    sum(case when token_out = '0x8790f2fc7ca2e7db841307fb3f4e72a03baf7b47' then amount_in end) as usdc_spent,
    sum(case when token_in = '0x8790f2fc7ca2e7db841307fb3f4e72a03baf7b47' then amount_in / pow(10,18) end) as tokens_sold,
    sum(case when token_in = '0x8790f2fc7ca2e7db841307fb3f4e72a03baf7b47' then amount_out end) as usdc_received
    from ethereum.core.ez_dex_swaps
    where contract_address = '0xe59fd78557093a0beb569369ef8f47bc48a32c75'
    group by 1
    order by 5 desc
    -- limit 3
    Run a query to Download Data