MLDZMNhel5
    Updated 2023-05-05
    with t1 as (select
    recorded_hour::date as day,
    token_address,
    avg(close) as token_price
    from solana.core.ez_token_prices_hourly prices
    group by 1,2
    )




    select
    block_timestamp::date as date,
    case
    when mint = 'hntyVP6YFm1Hg25TN9WGLqM12b8TQmcknKrdu1oxWux' then 'HNT'
    when mint = 'iotEVVZLEywoTn1QdwNPddxPWszn3zFhEot3MfL9fns' then 'IOT'
    when mint = 'mb1eu7TzEc71KxDpsmsKoucSSuuoGLv1drys1oP2jh6' then 'MOBILE'
    when mint = 'dcuc8Amr83Wz27ZkQ2K9NS6r8zRpf1J6cvArEBDZDmm' then 'DC'
    when mint = 'So11111111111111111111111111111111111111112' then 'SOL'
    end as symbol,
    sum(amount) as volume,
    sum(amount*token_price) as volume_usd,
    avg(amount*token_price) as avg_volume,
    median(amount*token_price) as median_volume,
    count(distinct tx_to) as no_wallets
    from solana.core.fact_transfers s
    inner join solana.core.fact_events e
    using(block_timestamp, tx_id)
    left join t1 a on s.mint=a.token_address
    where succeeded
    and e.program_id = '1atrmQs3eq1N2FEYWu6tyTXbCjP4uQwExpjtnhXtS8h' -- migration lazy transactions
    and signers[0] = 'mgrArTL62g582wWV6iM4fwU1LKnbUikDN6akKJ76pzK'
    and mint in (
    'hntyVP6YFm1Hg25TN9WGLqM12b8TQmcknKrdu1oxWux', -- HNT
    'iotEVVZLEywoTn1QdwNPddxPWszn3zFhEot3MfL9fns', -- IOT
    'mb1eu7TzEc71KxDpsmsKoucSSuuoGLv1drys1oP2jh6', -- MOBILE
    Run a query to Download Data