From 21562fe04d54689d0e74456256798ac3a6adb741 Mon Sep 17 00:00:00 2001 From: Shawn Rizo Date: Fri, 3 Oct 2025 11:09:56 -0400 Subject: [PATCH 1/2] feat: Add TradeInitiated Event --- src/onchain/TestArbitrage.sol | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/onchain/TestArbitrage.sol b/src/onchain/TestArbitrage.sol index 85d9f13..21c0669 100644 --- a/src/onchain/TestArbitrage.sol +++ b/src/onchain/TestArbitrage.sol @@ -155,6 +155,24 @@ contract TestArbitrage is IFlashLoanRecipient, ReentrancyGuard, Ownable, Pausabl // EVENTS // ////////////////////////////////////////////////////////////// + /// @notice Emitted when a trade is initiated + /// @param tradeId Unique identifier for this trade + /// @param tokenIn Input token address + /// @param tokenOut Output token address + /// @param flashAmount Amount being flash loaned + /// @param router1 First router address + /// @param router2 Second router address + /// @param initiator Address that initiated the trade + event TradeInitiated( + uint256 indexed tradeId, + address indexed tokenIn, + address indexed tokenOut, + uint256 flashAmount, + address router1, + address router2, + address initiator + ); + /// @notice Emitted when contract configuration is updated /// @param parameter Name of the parameter changed /// @param oldValue Previous value From ce74beb53ca5d2a697fade396a035b13394afeba Mon Sep 17 00:00:00 2001 From: Shawn Rizo Date: Fri, 3 Oct 2025 11:10:20 -0400 Subject: [PATCH 2/2] feat: Add TradeCompleted Event --- src/onchain/TestArbitrage.sol | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/onchain/TestArbitrage.sol b/src/onchain/TestArbitrage.sol index 21c0669..357d517 100644 --- a/src/onchain/TestArbitrage.sol +++ b/src/onchain/TestArbitrage.sol @@ -173,6 +173,13 @@ contract TestArbitrage is IFlashLoanRecipient, ReentrancyGuard, Ownable, Pausabl address initiator ); + /// @notice Emitted when a trade completes successfully + /// @param tradeId Unique identifier for this trade + /// @param profit Net profit from the arbitrage + /// @param gasUsed Total gas consumed + /// @param executionTime Time taken for execution (in seconds) + event TradeCompleted(uint256 indexed tradeId, uint256 profit, uint256 gasUsed, uint256 executionTime); + /// @notice Emitted when contract configuration is updated /// @param parameter Name of the parameter changed /// @param oldValue Previous value