NakedCollector2023-03-18 04:22 PM
    with buy as (
    select
    date_trunc('day', block_timestamp) as day,
    sum(amount_usd) as sales
    from ethereum.dex_swaps
    where token_address = '0x23b608675a2b2fb1890d3abbd85c5775c51691d5'
    and direction = 'OUT'
    group by day
    ),

    price as (
    select
    date_trunc('day', hour) as day,
    avg(price) as price
    from ethereum.token_prices_hourly
    where token_address = '0x23b608675a2b2fb1890d3abbd85c5775c51691d5'
    group by day
    )

    select
    buy.day as day,
    buy.sales as sales_volume,
    price.price as socks_price
    from buy
    inner join price on buy.day = price.day
    Run a query to Download Data