Skip to content

Commit

Permalink
Update lifinity_v1_base_trades.sql (#7292)
Browse files Browse the repository at this point in the history
same update to v2
  • Loading branch information
smyyguy authored Dec 11, 2024
1 parent f5aba92 commit fd8b1de
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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))
Expand Down

0 comments on commit fd8b1de

Please sign in to comment.