pepperatziCook Power Metrics
    Updated 2025-01-14
    --0x72362d760aec774f91Be7A34981FB6406Fb20A7C COOK feast staking contract
    with deposits as (
    SELECT
    block_timestamp,
    tx_hash,
    decoded_log:owner::string as user,
    'Deposit' as event_name,
    decoded_log:amount::int /1e18 as raw_staked,
    decoded_log:duration::int / 86400 as duration_locked
    from mantle.core.ez_decoded_event_logs
    where contract_address = lower('0x72362d760aec774f91Be7A34981FB6406Fb20A7C')
    and event_name = 'DepositWithDuration'
    ),

    withdraws as (
    SELECT
    block_timestamp,
    tx_hash,
    decoded_log:assets::int / 1e18 as amount_withdrawn,
    decoded_log:receiver::string as to_address,
    decoded_log:sender::string as from_address
    from mantle.core.ez_decoded_event_logs
    where contract_address = lower('0x72362d760aec774f91Be7A34981FB6406Fb20A7C')
    and event_name = 'Withdraw'
    ),

    prices as (
    SELECT
    hour,
    price
    from mantle.price.ez_prices_hourly
    where token_address = lower('0x9F0C013016E8656bC256f948CD4B79ab25c7b94D')
    ),

    base_deposits as (
    SELECT
    QueryRunArchived: QueryRun has been archived