talebimorteza_72Untitled Query
    with DestinationChainT as
    ( select block_timestamp, tx_id,attribute_value as Destination_Chain
    from axelar.core.fact_msg_attributes
    where tx_succeeded = 'TRUE'
    and attribute_key = 'destinationChain'),

    OriginChainT as (
    select block_timestamp,
    tx_id,
    attribute_value as Origin_Chain
    from axelar.core.fact_msg_attributes
    where tx_succeeded = 'TRUE'
    and attribute_key = 'sourceChain'
    and tx_id in (select tx_id from DestinationChainT)),

    OriginUserT as
    (select block_timestamp,tx_id,attribute_value as Origin_User
    from axelar.core.fact_msg_attributes
    where tx_succeeded = 'TRUE'
    and attribute_key = 'sender'and tx_id in (select tx_id from DestinationChainT)),

    BridgeT as
    (select block_timestamp,tx_id, attribute_value
    from axelar.core.fact_msg_attributes
    where msg_type = 'coin_spent'
    and attribute_index = 1and tx_id in (select tx_id from DestinationChainT)and tx_succeeded = 'TRUE'),

    main_table1 as
    (select t1.block_timestamp,t1.tx_id,Origin_Chain,Destination_Chain,Origin_User,
    Origin_Chain || ' To ' || Destination_Chain as Transfer_Path,
    attribute_value as tokenn
    from OriginChainT t1 join OriginUserT t2 on t1.tx_id = t2.tx_id and t1.block_timestamp::date = t2.block_timestamp::date
    join DestinationChainT t3 on t1.tx_id = t3.tx_id and t1.block_timestamp::date = t3.block_timestamp::date
    join BridgeT t5 on t1.tx_id = t5.tx_id and t1.block_timestamp::date = t5.block_timestamp::date),

    main_table2 as (