adambalaUntitled Query
    Updated 2022-12-07
    select block_timestamp,
    'Uniswap' as platform,
    a.tx_hash,
    a.origin_from_address swapper,
    ((c.price * b.raw_amount)/pow(10, c.decimals)) as AMOUNT_IN_USD
    from ETHEREUM.core.fact_event_logs a
    join ETHEREUM.core.fact_token_transfers b using(tx_hash)
    join ETHEREUM.core.fact_hourly_token_prices c on c.token_address = b.contract_address and date_trunc('hour', b.block_timestamp) = c.hour
    where a.event_name = 'Swap'
    and a.origin_to_address in (select distinct ADDRESS from ETHEREUM.core.dim_labels where label_type = 'dex' and LABEL ilike '%Uniswap%')
    and a.tx_status ='SUCCESS' and a.block_timestamp >= '2022-01-01' -- and token_address = '0x4200000000000000000000000000000000000042'
    LIMIT 1
    Run a query to Download Data