hbd1994Actions and Collections
    Updated 2023-10-11
    with main as (
    with Dagora_marketplaces as (
    select
    date_trunc('day',BLOCK_TIMESTAMP) as date,
    tx_id,
    msg_index,
    MSG_TYPE,
    MSG_GROUP
    from sei.core.fact_msg_attributes a
    where msg_type = 'wasm-set-exchange-message'
    and ATTRIBUTE_KEY = '_contract_address'
    and ATTRIBUTE_VALUE = 'sei1pdwlx9h8nc3fp6073mweug654wfkxjaelgkum0a9wtsktwuydw5sduczvz'
    and BLOCK_TIMESTAMP >= '2023-08-15'
    ),

    detail as (select
    date_trunc('day',BLOCK_TIMESTAMP) as date,
    tx_id,
    msg_index,
    MSG_TYPE,
    MSG_GROUP,
    tx_from as user,
    listagg(case when ATTRIBUTE_KEY = 'start-time' then ATTRIBUTE_VALUE end) as start_date,
    listagg(case when ATTRIBUTE_KEY = 'end-time' then ATTRIBUTE_VALUE end) as end_date,
    split(listagg(case when ATTRIBUTE_KEY = 'nft' then ATTRIBUTE_VALUE end),',') as nft_datails,
    listagg(case when ATTRIBUTE_KEY = 'request-key' then ATTRIBUTE_VALUE end) as request_key
    from sei.core.fact_msg_attributes a
    join sei.core.fact_transactions using(tx_id)
    where tx_id in (select distinct tx_id from Dagora_marketplaces)
    and BLOCK_TIMESTAMP >= '2023-08-15'
    and msg_type = 'wasm-set-exchange-message'
    group by 1,2,3,4,5,6),

    final_list as (
    select
    a.date,
    Run a query to Download Data