mattkstewProposal Descriptions
    Updated 2023-02-01
    with tab1 as (
    select
    tx_hash

    from near.core.fact_transactions
    where TX_RECEIVER like 'marketing.sputnik-dao.near'
    )

    , tab2 as (
    select
    block_timestamp as date,
    Parse_JSON(args) as Args


    from near.core.fact_actions_events_function_call
    where tx_hash in (select * from tab1)
    and method_name like 'add_proposal'
    )

    , tab3 as (
    select
    date_trunc('day', date) as date,
    args:proposal:description as info,
    regexp_substr(Args, '"amount":"([^"]+)"') as amount,
    regexp_substr(Args, '"receiver_id":"([^"]+)"') as receiver_id
    from tab2
    )


    select
    date_trunc('day', date) as Date,
    info as Descriptions
    from tab3
    order by 1 desc

    Run a query to Download Data