Updated 2024-09-28
    with

    pricet as (
    select
    hour::date as date,
    symbol,
    decimals,
    avg(price) as token_price_usd
    from
    aptos.price.ez_prices_hourly
    where
    symbol = 'APT'
    group by 1, 2, 3

    union all

    select
    recorded_hour::date as date,
    symbol,
    6,
    avg(price) as token_price_usd
    from
    osmosis.price.ez_prices
    where
    symbol in ('OSMO', 'ATOM')
    group by 1, 2, 3
    ),

    main as (
    select
    tx_hash,
    block_timestamp,
    amount_usd,
    origin_to_address as user,
    'Matic' as symbol,
    'Polygon' as chain
    QueryRunArchived: QueryRun has been archived