Skip to content

Commit

Permalink
joe v2 tables incremental
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwes committed Oct 24, 2024
1 parent 172a89a commit 3eb02de
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions macros/trader_joe_v_2/trader_joe_v_2_1_swaps.sql
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ WITH lbpairs AS ( -- Step 1: Extract all Pools addresses that were create
SELECT lbpair_address FROM lbpairs
)
AND event_name = 'Swap'
{% if is_incremental() %}
AND block_timestamp > (SELECT MAX(block_timestamp) FROM {{this}})
{% endif %}
)
SELECT
s.block_timestamp,
Expand Down
3 changes: 3 additions & 0 deletions macros/trader_joe_v_2/trader_joe_v_2_2_swaps.sql
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ WHERE
lbpairs
)
AND topics[0] = '0xad7d6f97abf51ce18e17a38f4d70e975be9c0708474987bb3e26ad21bd93ca70'
{% if is_incremental() %}
AND block_timestamp > (SELECT MAX(block_timestamp) FROM {{this}})
{% endif %}
)
SELECT
s.block_timestamp,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{
config(
materialized="table",
materialized="incremental",
snowflake_warehouse="TRADER_JOE",
)
}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{
config(
materialized="table",
materialized="incremental",
snowflake_warehouse="TRADER_JOE",
)
}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{
config(
materialized="table",
materialized="incremental",
snowflake_warehouse="TRADER_JOE",
)
}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{
config(
materialized="table",
materialized="incremental",
snowflake_warehouse="TRADER_JOE",
)
}}
Expand Down

0 comments on commit 3eb02de

Please sign in to comment.