Afonso_DiazOvertime
    Updated 2025-04-22
    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,
    Last run: about 1 month ago
    DATE
    DEPOSITS_MSOL
    UNSTAKE_MSOL
    DEPOSITS_USD
    UNSTAKE_USD
    1
    2021-08-01 00:00:00.000700458.70488416430847.51575895835705099.1531944791026.921482687
    2
    2021-09-01 00:00:00.0001981437.11281808216898.5023277280440561.62281930101974.5800071
    3
    2021-10-01 00:00:00.0004861195.49424571243862.800616694727607715.16718847079073.8795006
    4
    2021-11-01 00:00:00.000219041.176247728690552.39247561550580854.8805409165834796.265682
    5
    2021-12-01 00:00:00.000979597.270674163397310.600936639183898544.00850872946630.1819042
    6
    2022-01-01 00:00:00.0001043933.199163461816477.0932477151604390.304568249962216.911287
    7
    2022-02-01 00:00:00.000680204.603768764608197.89809748769168865.493061761583787.9628869
    8
    2022-03-01 00:00:00.000739061.457441136891072.02890438771676519.89731184759146.2992294
    9
    2022-04-01 00:00:00.000542293.320350061491603.90785405862844901.602459855792105.2181927
    10
    2022-05-01 00:00:00.000593316.5334672541010380.0539922741438460.78373260692488.8446119
    11
    2022-06-01 00:00:00.0001386931.20424869726769.11494445551359539.61395726998535.6749323
    12
    2022-07-01 00:00:00.000764025.985954937338592.67756106932272009.581626214109776.9463767
    13
    2022-08-01 00:00:00.0001018250.022591011337292.5791241444329269.167478955583323.6723064
    14
    2022-09-01 00:00:00.000472561.324167615243457.2576884316363430.05527898653599.43833631
    15
    2022-10-01 00:00:00.0001646598.534134631569491.7949711652315455.332262851435238.1023773
    16
    2022-11-01 00:00:00.000358340.9936781422889969.845103878408533.5216506268696713.794439
    17
    2022-12-01 00:00:00.000302878.511415025427945.8183331964224167.823912536137987.74459212
    18
    2023-01-01 00:00:00.000333032.659695274489416.9229105927021522.826890110511330.4607179
    19
    2023-02-01 00:00:00.000219601.102037319155881.529881885590503.117133653977374.29542817
    20
    2023-03-01 00:00:00.000318584.712486966364278.4161861517284152.453714288335643.43828141
    45
    4KB
    9s