adriaparcerisasmissing swaps on terra
    Updated 2021-11-19
    with missing as (select
    date_trunc('day', block_timestamp) as day,
    tx_id
    from terra.msg_events
    where
    event_type = 'from_contract'
    --and date_trunc('day', block_timestamp) = '2021-03-21'
    and tx_status = 'SUCCEEDED'
    and event_attributes['action'] is null
    and (
    (event_attributes['0_contract_address'] = 'terra1tndcaqxkpc5ce9qee5ggqf430mr2z3pefe5wj6'
    and event_attributes['0_action'] = 'swap')
    or
    (event_attributes['1_contract_address'] = 'terra1tndcaqxkpc5ce9qee5ggqf430mr2z3pefe5wj6'
    and event_attributes['1_action'] = 'swap')
    or
    (event_attributes['2_contract_address'] = 'terra1tndcaqxkpc5ce9qee5ggqf430mr2z3pefe5wj6'
    and event_attributes['2_action'] = 'swap')
    or
    (event_attributes['3_contract_address'] = 'terra1tndcaqxkpc5ce9qee5ggqf430mr2z3pefe5wj6'
    and event_attributes['3_action'] = 'swap')
    or
    (event_attributes['4_contract_address'] = 'terra1tndcaqxkpc5ce9qee5ggqf430mr2z3pefe5wj6'
    and event_attributes['4_action'] = 'swap')
    or
    (event_attributes['5_contract_address'] = 'terra1tndcaqxkpc5ce9qee5ggqf430mr2z3pefe5wj6'
    and event_attributes['5_action'] = 'swap')
    or
    (event_attributes['6_contract_address'] = 'terra1tndcaqxkpc5ce9qee5ggqf430mr2z3pefe5wj6'
    and event_attributes['6_action'] = 'swap')
    or
    (event_attributes['7_contract_address'] = 'terra1tndcaqxkpc5ce9qee5ggqf430mr2z3pefe5wj6'
    and event_attributes['7_action'] = 'swap')
    )
    )

    Run a query to Download Data