diff --git a/dbt_subprojects/dex/macros/models/_project/paraswap/delta/map_internal_to_dex.sql b/dbt_subprojects/dex/macros/models/_project/paraswap/delta/map_internal_to_dex.sql index 93f20488732..319b5ba95ec 100644 --- a/dbt_subprojects/dex/macros/models/_project/paraswap/delta/map_internal_to_dex.sql +++ b/dbt_subprojects/dex/macros/models/_project/paraswap/delta/map_internal_to_dex.sql @@ -26,8 +26,8 @@ select call_tx_hash as tx_hash, call_tx_from as tx_from, call_tx_to as tx_to, - call_trace_address as trace_address, - evt_index, + case when CARDINALITY(call_trace_address) > 0 then call_trace_address else ARRAY[-1] end as trace_address, + COALESCE(evt_index, 0) as evt_index, -- TMP: after joining envents in swapSettle can remove it order_index, method from {{from_alias}}