SocioAnalyticaFrom Aptos
    Updated 2024-10-10

    with prices as (
    select
    date_trunc('day', hour) as date,
    token_address,
    symbol,
    median(price) as usd_price
    from aptos.price.ez_prices_hourly
    group by 1 , 2 , 3
    union all
    select
    date_trunc('day', hour) as date,
    token_address,
    symbol,
    median(price) as usd_price
    from ethereum.price.ez_prices_hourly
    where symbol IN ('USDT', 'WBTC', 'SOL','CELO','WBNB','WGLMR','WMATIC','WAVAX','SEI','SUI')
    group by 1 , 2 , 3
    )
    ,
    base as (
    select c.* ,
    amount * usd_price as amount_usd
    from (
    select
    block_timestamp,
    tx_hash,
    platform,
    event_name,
    direction,
    sender,
    receiver,
    source_chain_id,
    source_chain_name,
    destination_chain_id,
    destination_chain_name,
    QueryRunArchived: QueryRun has been archived