diff --git a/src/monitoring_tests/cost_coverage_zero_signed_fee.py b/src/monitoring_tests/cost_coverage_zero_signed_fee.py index 0d58c2f..9a81b70 100644 --- a/src/monitoring_tests/cost_coverage_zero_signed_fee.py +++ b/src/monitoring_tests/cost_coverage_zero_signed_fee.py @@ -8,7 +8,6 @@ from src.monitoring_tests.base_test import BaseTest from src.apis.web3api import Web3API from src.apis.orderbookapi import OrderbookAPI -from src.constants import DAY_BLOCK_INTERVAL, CAP_PARAMETER class CostCoverageForZeroSignedFee(BaseTest): @@ -37,17 +36,12 @@ def cost_coverage(self, competition_data: dict[str, Any], gas_cost: float) -> bo solution = competition_data["solutions"][-1] tx_hash = competition_data["transactionHash"] - print("Processing " + tx_hash) - solver = solution["solver"] ucp = solution["clearingPrices"] orders = solution["orders"] native_prices = competition_data["auction"]["prices"] total_fee = 0 - for x in orders: - id = x["id"] - raw_sell_amount = int(x["sellAmount"]) - raw_buy_amount = int(x["buyAmount"]) - order_data = self.orderbook_api.get_order_data(id) + for order in orders: + order_data = self.orderbook_api.get_order_data(order["id"]) if order_data is None: return False sell_token = order_data["sellToken"] @@ -63,8 +57,10 @@ def cost_coverage(self, competition_data: dict[str, Any], gas_cost: float) -> bo fee = ( ( - raw_sell_amount - - raw_buy_amount * int(ucp[buy_token]) / int(ucp[sell_token]) + int(order["sellAmount"]) + - int(order["buyAmount"]) + * int(ucp[buy_token]) + / int(ucp[sell_token]) ) * int(native_prices[sell_token]) / 10**36