From fd8b1de206f81c050fc8f2e641a6a540be41e4e8 Mon Sep 17 00:00:00 2001 From: Dan Smith | Blockworks Research <119909738+smyyguy@users.noreply.github.com> Date: Wed, 11 Dec 2024 12:51:39 -0500 Subject: [PATCH] Update lifinity_v1_base_trades.sql (#7292) same update to v2 --- .../models/_sector/dex/lifinity/lifinity_v1_base_trades.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbt_subprojects/solana/models/_sector/dex/lifinity/lifinity_v1_base_trades.sql b/dbt_subprojects/solana/models/_sector/dex/lifinity/lifinity_v1_base_trades.sql index c5ac3d3a3ff..8c012e3a950 100644 --- a/dbt_subprojects/solana/models/_sector/dex/lifinity/lifinity_v1_base_trades.sql +++ b/dbt_subprojects/solana/models/_sector/dex/lifinity/lifinity_v1_base_trades.sql @@ -45,7 +45,7 @@ WITH order by COALESCE(tr_2.inner_instruction_index, 0) asc) as first_transfer_out FROM {{ source('lifinity_amm_solana', 'lifinity_amm_call_swap') }} sp INNER JOIN {{ ref('tokens_solana_transfers') }} tr_1 - ON tr_1.tx_id = sp.call_tx_id + ON tr_1.tx_id = sp.call_tx_id AND tr_1.action = 'transfer' AND tr_1.outer_instruction_index = sp.call_outer_instruction_index AND ((sp.call_is_inner = false AND tr_1.inner_instruction_index = 1) OR (sp.call_is_inner = true AND tr_1.inner_instruction_index = sp.call_inner_instruction_index + 1)) @@ -57,7 +57,7 @@ WITH {% endif %} --swap out can be either 2nd or 3rd transfer. INNER JOIN {{ ref('tokens_solana_transfers') }} tr_2 - ON tr_2.tx_id = sp.call_tx_id + ON tr_2.tx_id = sp.call_tx_id AND tr_2.action = 'transfer' AND tr_2.outer_instruction_index = sp.call_outer_instruction_index AND ((sp.call_is_inner = false AND (tr_2.inner_instruction_index = 2 OR tr_2.inner_instruction_index = 3)) OR (sp.call_is_inner = true AND (tr_2.inner_instruction_index = sp.call_inner_instruction_index + 2 OR tr_2.inner_instruction_index = sp.call_inner_instruction_index + 3))