maybeyonassei_silo_balance
    Updated 2024-12-02
    with

    rate_msg as (
    select
    block_timestamp,
    block_id,
    tx_id,

    TRY_BASE64_DECODE_STRING(msg:attributes[2]:value) as rate
    from sei.core.fact_msgs --_attributes
    where 1=1
    and block_id > 49670328
    and msg_type = 'wasm'
    -- -- "_contract_address"
    and msg:attributes[0]:key = 'X2NvbnRyYWN0X2FkZHJlc3M='
    -- sei1e3gttzq5e5k49f9f5gzvrl0rltlav65xu6p9xc0aj7e84lantdjqp7cncc
    and msg:attributes[0]:value = 'c2VpMWUzZ3R0enE1ZTVrNDlmOWY1Z3p2cmwwcmx0bGF2NjV4dTZwOXhjMGFqN2U4NGxhbnRkanFwN2NuY2M='
    -- -- "action"
    and msg:attributes[2]:key = 'ZXhjaGFuZ2VfcmF0ZQ=='
    ),
    daily_rate as (
    select
    date(block_timestamp) as date,
    max(rate) as rate
    from rate_msg
    group by 1
    ),
    bond_msgs as (
    select
    block_timestamp,
    block_id,
    tx_id,

    'bond' as action,
    TRY_BASE64_DECODE_STRING(msg:attributes[1]:value) as user,
    QueryRunArchived: QueryRun has been archived