rajsETH Deposited To Optimism
    Updated 2022-09-13
    with prices as
    (
    SELECT
    *
    -- distinct symbol
    from optimism.core.fact_hourly_token_prices
    -- where symbol ilike '%eth%'
    where symbol = 'ETH'
    )

    SELECT
    -- *
    min(block_timestamp) as min_date,
    sum(raw_amount/pow(10,18)) as eth_amount,
    sum(raw_amount/pow(10,18) * price) as usd_amount,
    sum(raw_amount/pow(10,24) * price) as usd_amount_million
    from optimism.core.fact_token_transfers t
    left join prices p
    on date_trunc('hour', t.block_timestamp) = p.hour
    -- where tx_hash = '0x5ef691d76af11a553870b8e71aeb6af4b088f6500c47ce0b84029f5ba5c32193'
    where origin_to_address = '0x4200000000000000000000000000000000000007'
    and from_address = '0x0000000000000000000000000000000000000000'
    and contract_address = '0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000'
    -- and block_timestamp::date >= CURRENT_DATE - interval '30 days'
    Run a query to Download Data