From 11a07f4d063048de73bf2db9d984fbb02ca55501 Mon Sep 17 00:00:00 2001 From: 0xRob <83790096+0xRobin@users.noreply.github.com> Date: Thu, 19 Dec 2024 11:35:51 +0100 Subject: [PATCH] Fix for kyberswap aggregator: ignore 1 specific token (#7352) * ignore 1 specific token * syntax --- .../kyberswap_aggregator_avalanche_c_trades.sql | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dbt_subprojects/dex/models/_projects/kyberswap/avalanche_c/kyberswap_aggregator_avalanche_c_trades.sql b/dbt_subprojects/dex/models/_projects/kyberswap/avalanche_c/kyberswap_aggregator_avalanche_c_trades.sql index 635d3fb2724..2061a3ddc8b 100644 --- a/dbt_subprojects/dex/models/_projects/kyberswap/avalanche_c/kyberswap_aggregator_avalanche_c_trades.sql +++ b/dbt_subprojects/dex/models/_projects/kyberswap/avalanche_c/kyberswap_aggregator_avalanche_c_trades.sql @@ -1,6 +1,6 @@ {{ config ( - + schema = 'kyberswap_aggregator_avalanche_c', alias = 'trades', partition_by = ['block_month'], @@ -36,8 +36,11 @@ WITH meta_router AS ,ARRAY[-1] AS trace_address FROM {{ source('kyber_avalanche_c', 'MetaAggregationRouterV2_evt_Swapped') }} + WHERE 0x250f8f7750735e3ab5dc9db3a542f6b71999ed38 not in (dstToken, srcToken) + -- There are 2 weird transactions with this token where the return and spent amounts in the event are not correct + -- these result in inflated volume, so we'll ignore this token in any trades. {% if is_incremental() %} - WHERE evt_block_time >= date_trunc('day', now() - INTERVAL '7' DAY) + AND evt_block_time >= date_trunc('day', now() - INTERVAL '7' DAY) {% endif %} ) SELECT