From 005c75dd441bb1454316f38d4527ecbbebf5f777 Mon Sep 17 00:00:00 2001 From: Felix Henneke Date: Thu, 5 Oct 2023 13:43:43 +0200 Subject: [PATCH] Ignore ETH wrapping transfers (#322) Before only transfers from WETH to the contract were ignored. Those correspond to unwraps/withdrawals. With this change, also transfers from the protocol to WETH are ignored. Those correspond to wraps/deposits. The general idea is that all transfers between the protocol and WETH should correspond to wrapping and unwrapping. Such operations do change the ETH balance and WETH balance without incurring any slippage or change in value of the buffers. --- queries/dune_v2/period_slippage.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/queries/dune_v2/period_slippage.sql b/queries/dune_v2/period_slippage.sql index 6ab0ba61..94446cbb 100644 --- a/queries/dune_v2/period_slippage.sql +++ b/queries/dune_v2/period_slippage.sql @@ -1,4 +1,4 @@ --- https://github.com/cowprotocol/solver-rewards/pull/259 +-- https://github.com/cowprotocol/solver-rewards/pull/322 -- Query Here: https://dune.com/queries/2421375 with batch_meta as ( @@ -121,7 +121,7 @@ batch_meta as ( and success = true and 0x9008d19f58aabd9ed0d60971565aa8510560ab41 in (to, "from") -- WETH unwraps don't have cancelling WETH transfer. - and "from" != 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 + and not 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 in (to, "from") -- ETH transfers to traders are already part of USER_OUT and not contains(traders_out, to) )