From d11cfe774dbd972dd2e7d9f6c027c3941bfeaf5c Mon Sep 17 00:00:00 2001 From: Haris Angelidakis <64154020+harisang@users.noreply.github.com> Date: Wed, 21 Aug 2024 18:02:28 +0300 Subject: [PATCH] Add Copium Capital MEV Blocker kickbacks (#112) This PR adds the current address where Copium receives kickbacks, for monitoring purposes. --------- Co-authored-by: Felix Henneke --- src/constants.py | 6 +++++- .../mev_blocker_kickbacks_test.py | 20 ++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/constants.py b/src/constants.py index 07e1dd9..7752f1e 100644 --- a/src/constants.py +++ b/src/constants.py @@ -39,7 +39,11 @@ # relevant addresses SETTLEMENT_CONTRACT_ADDRESS = "0x9008D19f58AAbD9eD0D60971565AA8510560ab41" -MEV_BLOCKER_KICKBACKS_ADDRESS = "0xCe91228789B57DEb45e66Ca10Ff648385fE7093b" +MEV_BLOCKER_KICKBACKS_ADDRESSES = [ + "0xCe91228789B57DEb45e66Ca10Ff648385fE7093b", # CoW DAO + "0x008300082C3000009e63680088f8c7f4D3ff2E87", # Copium Capital + "0xbAda55BaBEE5D2B7F3B551f9da846838760E068C", # Project Blanc +] # requests REQUEST_TIMEOUT = 5 diff --git a/src/monitoring_tests/mev_blocker_kickbacks_test.py b/src/monitoring_tests/mev_blocker_kickbacks_test.py index 81db89f..904d23d 100644 --- a/src/monitoring_tests/mev_blocker_kickbacks_test.py +++ b/src/monitoring_tests/mev_blocker_kickbacks_test.py @@ -8,7 +8,7 @@ from src.monitoring_tests.base_test import BaseTest from src.apis.web3api import Web3API from src.constants import ( - MEV_BLOCKER_KICKBACKS_ADDRESS, + MEV_BLOCKER_KICKBACKS_ADDRESSES, KICKBACKS_ALERT_THRESHOLD, ) @@ -32,19 +32,25 @@ def run(self, tx_hash: str) -> bool: if block_number is None: return False - total_eth_kickbacks = self.web3_api.get_eth_transfers_by_block_range( - block_number, block_number, MEV_BLOCKER_KICKBACKS_ADDRESS - ) - if total_eth_kickbacks is None: + eth_kickbacks = None + for address in MEV_BLOCKER_KICKBACKS_ADDRESSES: + kickback = self.web3_api.get_eth_transfers_by_block_range( + block_number, block_number, address + ) + if kickback is not None: + eth_kickbacks = kickback + break + + if eth_kickbacks is None: return False log_output = "\t".join( [ "MEV Blocker kickbacks test:", f"Tx Hash: {tx_hash}", - f"Kickback: {total_eth_kickbacks:.5f}ETH", + f"Kickback: {eth_kickbacks:.5f}ETH", ] ) - if total_eth_kickbacks >= KICKBACKS_ALERT_THRESHOLD: + if eth_kickbacks >= KICKBACKS_ALERT_THRESHOLD: self.alert(log_output) else: self.logger.info(log_output)