From 763afc1e0508b5d45e0e59f72585868675aee2ef Mon Sep 17 00:00:00 2001 From: mattromano Date: Thu, 15 Feb 2024 20:15:53 -0800 Subject: [PATCH] aave token fix --- .../silver/defi/lending/aave/silver__aave_tokens.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/models/silver/defi/lending/aave/silver__aave_tokens.sql b/models/silver/defi/lending/aave/silver__aave_tokens.sql index 8031707..5398a2c 100644 --- a/models/silver/defi/lending/aave/silver__aave_tokens.sql +++ b/models/silver/defi/lending/aave/silver__aave_tokens.sql @@ -88,6 +88,12 @@ AND _inserted_timestamp >= ( WHERE atoken_version = 'Aave V3' ) +AND contract_address NOT IN ( + SELECT + atoken_address + FROM + {{ this }} +) {% endif %} ), a_token_step_1 AS ( @@ -194,6 +200,12 @@ aave_token_pull AS ( WHERE atoken_version = 'Aave V2' ) + AND CONCAT('0x', SUBSTR(topics [2] :: STRING, 27, 40)) NOT IN ( + SELECT + atoken_address + FROM + {{ this }} +) {% endif %} ), aave_token_pull_2 AS (