Salehsei_nft_main_top_nft_volume_Sei Portals
    Updated 2024-03-06
    -- forked from sei_nft_main_top_nft_volume_dob @ https://flipsidecrypto.xyz/edit/queries/3688fc7f-da44-4be9-b995-a0df417ab9ff


    with lst_buyer as (
    select
    tx_id
    ,ATTRIBUTE_VALUE as buyer
    ,msg_index
    from sei.core.fact_msg_attributes
    where MSG_TYPE = 'wasm'
    and block_timestamp::date>='2023-12-27'
    and ATTRIBUTE_KEY = 'recipient'
    and tx_succeeded = true
    )
    ,lst_amount_seller as (
    select
    tx_id
    ,split(ATTRIBUTE_VALUE,'usei')[0]/1e6 as amount_sell
    ,msg_index
    from sei.core.fact_msg_attributes
    where block_timestamp::date>='2023-12-27'
    and MSG_TYPE = 'wasm-buy_now'
    and ATTRIBUTE_KEY = 'sale_price'
    and tx_succeeded = true
    )
    ,lst_contract_address as (
    select
    tx_id
    ,ATTRIBUTE_VALUE as contract_address
    ,msg_index
    from sei.core.fact_msg_attributes
    where block_timestamp::date>='2023-12-27'
    and MSG_TYPE = 'wasm-buy_now'
    and ATTRIBUTE_KEY = '_contract_address'
    and tx_succeeded = true
    QueryRunArchived: QueryRun has been archived