From 0bf9e213bb66f72070712718d56bab4bc683ce48 Mon Sep 17 00:00:00 2001 From: Jack Forgash <58153492+forgxyz@users.noreply.github.com> Date: Wed, 25 Sep 2024 13:10:15 -0600 Subject: [PATCH] fix swap->Swap --- .../curated/defi/silver__dex_swaps_v2.sql | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/models/silver/curated/defi/silver__dex_swaps_v2.sql b/models/silver/curated/defi/silver__dex_swaps_v2.sql index 1bff524..ad8d77b 100644 --- a/models/silver/curated/defi/silver__dex_swaps_v2.sql +++ b/models/silver/curated/defi/silver__dex_swaps_v2.sql @@ -29,19 +29,20 @@ WITH swap_logs AS ( WHERE receipt_succeeded AND clean_log LIKE 'Swapped%' - AND receiver_id NOT LIKE '%dragon_bot.near' {% if var("MANUAL_FIX") %} + AND receiver_id NOT LIKE '%dragon_bot.near' + {% if var("MANUAL_FIX") %} AND {{ partition_load_manual('no_buffer') }} {% else %} -{% if is_incremental() %} -AND _modified_timestamp >= ( - SELECT - MAX(_modified_timestamp) - FROM - {{ this }} -) -{% endif %} -{% endif %} + {% if is_incremental() %} + AND _modified_timestamp >= ( + SELECT + MAX(_modified_timestamp) + FROM + {{ this }} + ) + {% endif %} + {% endif %} ), receipts AS ( SELECT @@ -61,19 +62,20 @@ receipts AS ( receipt_object_id FROM swap_logs - ) {% if var("MANUAL_FIX") %} + ) + {% if var("MANUAL_FIX") %} AND {{ partition_load_manual('no_buffer') }} {% else %} -{% if is_incremental() %} -AND _modified_timestamp >= ( - SELECT - MAX(_modified_timestamp) - FROM - {{ this }} -) -{% endif %} -{% endif %} + {% if is_incremental() %} + AND _modified_timestamp >= ( + SELECT + MAX(_modified_timestamp) + FROM + {{ this }} + ) + {% endif %} + {% endif %} ), swap_outcome AS ( SELECT @@ -161,7 +163,7 @@ parse_actions AS ( -- for multi-swaps, there is (often) one action with an array of input dicts that correspond with the swap index decoded_action :msg, -- Swap must be capitalized! Autoformat may change to "swap" - decoded_action :operation: swap, + decoded_action :operation :Swap, decoded_action ) ) :actions [swap_index],