Flipside TeamBASE stake+liquid stake MoM
    Updated 2025-03-20
    with matic_data as (
    with matic_liquid as (
    with MaticPrice as (select date_trunc('month', HOUR) AS date , median (PRICE) as MPrice
    from ethereum.price.ez_prices_hourly
    where SYMBOL = 'MATIC'
    group by 1) ,
    contracts as (with txs2 as (select TX_HASH
    from ethereum.core.ez_decoded_event_logs
    where CONTRACT_ADDRESS = '0x47cbe25bbdb40a774cc37e1da92d10c2c7ec897f'
    and CONTRACT_NAME = 'Matic Validator'
    and ORIGIN_FUNCTION_SIGNATURE = '0x6a761202'
    and ORIGIN_TO_ADDRESS = '0xfa7d2a996ac6350f4b56c043112da0366a59b74c') ,
    txs1 as (select TX_HASH
    from ethereum.core.ez_decoded_event_logs
    where CONTRACT_ADDRESS = '0x47cbe25bbdb40a774cc37e1da92d10c2c7ec897f'
    and CONTRACT_NAME = 'Matic Validator'
    and ORIGIN_FUNCTION_SIGNATURE = '0x4fdd20f1'
    and ORIGIN_TO_ADDRESS = '0x5e3ef299fddf15eaa0432e6e66473ace8c13d908')
    select date_trunc('month', BLOCK_TIMESTAMP) AS month,CONTRACT_ADDRESS
    from txs2 t left join ethereum.core.ez_decoded_event_logs e on t.TX_HASH=e.TX_HASH
    where EVENT_NAME = 'OwnershipTransferred'
    union
    select date_trunc('month', BLOCK_TIMESTAMP) AS month,CONTRACT_ADDRESS
    from txs1 t left join ethereum.core.ez_decoded_event_logs e on t.TX_HASH=e.TX_HASH
    where EVENT_NAME = 'OwnershipTransferred')
    , tot1 as (
    select
    date_trunc('month', BLOCK_TIMESTAMP) AS month,
    TO_ADDRESS as wallet,
    (RAW_AMOUNT / 1e18) as amount,
    CONTRACT_ADDRESS,
    'stake' as action
    from
    ethereum.core.ez_token_transfers
    where
    CONTRACT_ADDRESS in (
    Last run: about 1 month ago
    DMONTH
    LABEL
    TOTAL_STAKE
    LIQUID_STAKE
    LIQUID_PERC
    1
    2023-09-01 00:00:00.000ETH27229933.848693311317004.196282141.56
    2
    2023-09-01 00:00:00.000Matic3656782461.72744268732193.618917.35
    3
    2023-10-01 00:00:00.000ETH28005983.285155611364972.735676440.58
    4
    2023-10-01 00:00:00.000Matic3639099201.97176280960525.1668647.72
    5
    2023-11-01 00:00:00.000ETH28690576.966664411905696.971788341.5
    6
    2023-11-01 00:00:00.000Matic3520775002.71619274611733.719517.8
    7
    2023-12-01 00:00:00.000ETH28990309.829510912374053.855456442.68
    8
    2023-12-01 00:00:00.000Matic3449537129.75102306205294.897258.88
    9
    2024-01-01 00:00:00.000ETH29600023.875192913090911.582874244.23
    10
    2024-01-01 00:00:00.000Matic3621209555.10204318921857.8360868.81
    11
    2024-02-01 00:00:00.000ETH31378149.704277514168711.337269745.15
    12
    2024-02-01 00:00:00.000Matic3646148030.67033341269257.8201319.36
    13
    2024-03-01 00:00:00.000ETH32141663.898334914303603.308646244.5
    14
    2024-03-01 00:00:00.000Matic3603596521.82436338614704.9839.4
    15
    2024-04-01 00:00:00.000ETH32561128.786362514049094.63763843.15
    16
    2024-04-01 00:00:00.000Matic3665103710.43907335989765.751729.17
    17
    2024-05-01 00:00:00.000ETH32703222.462325314352224.629951243.89
    18
    2024-05-01 00:00:00.000Matic3631628624.52877340370866.1631039.37
    19
    2024-06-01 00:00:00.000ETH33283551.460693414653957.316658944.03
    20
    2024-06-01 00:00:00.000Matic3695939807.28423327035122.7963218.85
    26
    2KB
    380s