Afonso_Diaz2023-11-04 02:32 PM
    Updated 2023-11-04
    with

    t1 as (
    select

    ),

    t2 as (
    select
    tx_id,
    block_timestamp,
    nvl(try_parse_json(attribute_value):amount::float, 0) as amount_atom,
    fee/1e9 as fee_atom,
    try_parse_json(attribute_value):denom::string
    from cosmos.core.fact_msg_attributes
    join cosmos.core.fact_transactions
    using(tx_id, block_timestamp)
    where ATTRIBUTE_KEY ilike 'packet_data'
    and msg_type ilike 'send_packet'
    and split(try_parse_json(attribute_value):denom::string, '/')[0] in (select distinct address from cosmos.gov.fact_validators)
    and tx_id in (
    select distinct tx_id from cosmos.core.fact_msg_attributes
    where msg_type ilike 'send_packet'
    and attribute_value ilike 'channel-391'
    )
    )

    select * from t2
    Run a query to Download Data