SocioAnalyticabridge Fees over time
    Updated 2024-04-15
    with sei_network as (
    with sei_wormhole as (
    select tx_id, block_timestamp
    from (
    SELECT
    block_timestamp,
    tx_id
    FROM sei.core.fact_msg_attributes
    WHERE attribute_key = 'message.chain_id'
    and msg_type = 'wasm'
    AND ATTRIBUTE_VALUE is not null
    intersect
    SELECT
    block_timestamp,
    tx_id
    FROM sei.core.fact_msg_attributes
    WHERE attribute_key = 'transfer.recipient_chain'
    and msg_type = 'wasm'
    AND ATTRIBUTE_VALUE is not null
    and block_timestamp::date >= dateadd('day', -{{past_days}}, current_date))
    -- union all
    -- select
    -- tx_id,
    -- block_timestamp
    -- from sei.core.fact_transfers
    -- where block_timestamp::date >= dateadd('day', -{{past_days}}, current_date)
    -- and transfer_type = 'IBC_TRANSFER_OUT'
    )
    ,
    avg_price_sei as (
    SELECT
    date_trunc('day',RECORDED_HOUR) as day,
    avg(price) as usd_price
    FROM osmosis.price.ez_prices
    WHERE symbol = 'SEI'
    and day >= current_date - 90
    QueryRunArchived: QueryRun has been archived