Updated 2025-02-19
    with

    pricet as (
    select
    hour::date as date,
    symbol,
    avg(price) as token_price_usd
    from
    crosschain.price.ez_prices_hourly
    where
    token_address in ('mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So', 'So11111111111111111111111111111111111111112')
    and blockchain = 'solana'
    group by 1, 2
    ),

    main as (
    select
    tx_id,
    block_timestamp,
    provider_address as user,
    msol_minted as amount,
    msol_minted * token_price_usd as amount_usd,
    'Stake' as event_name
    from
    solana.marinade.ez_liquid_staking_actions
    left join
    pricet on block_timestamp::date = date and symbol = 'MSOL'
    where
    action_type in ('deposit', 'depositStakeAccount')

    union all

    select
    tx_id,
    block_timestamp,
    provider_address as user,
    QueryRunArchived: QueryRun has been archived