From ff7c9648708ba4e31bd0546479ab6e4c81cca27b Mon Sep 17 00:00:00 2001 From: nicholaspai <9457025+nicholaspai@users.noreply.github.com> Date: Mon, 19 Feb 2024 18:26:59 -0500 Subject: [PATCH] fix: Early exit when searching for unexecutable V2 slow fills (#1200) --- src/utils/FillUtils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils/FillUtils.ts b/src/utils/FillUtils.ts index a75fad5b8..c4012da05 100644 --- a/src/utils/FillUtils.ts +++ b/src/utils/FillUtils.ts @@ -152,7 +152,10 @@ export async function getFillDataForSlowFillFromPreviousRootBundle( // Find the first fill chronologically for matched deposit for the input fill. const allMatchingFills = sortEventsAscending( - allValidFills.filter((_fill) => sdkUtils.filledSameDeposit(_fill, fill) && versionFilter(fill, _fill)) + allValidFills.filter( + (_fill) => + _fill.depositId === fill.depositId && sdkUtils.filledSameDeposit(_fill, fill) && versionFilter(fill, _fill) + ) ); let firstFillForSameDeposit = allMatchingFills.find((_fill) => isFirstFillForDeposit(_fill));