Skip to content

Commit

Permalink
fix: low success rate of getting quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
chefjackson committed Jul 6, 2023
1 parent c97d694 commit 5823a04
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ function validateSuccessRate(
return undefined
}

function validateBlockNumbers(results: { blockNumber: bigint }[]): BlockConflictError | null {
function validateBlockNumbers(results: { blockNumber: bigint }[], tolerance = 3): BlockConflictError | null {
if (results.length <= 1) {
return null
}
Expand All @@ -309,7 +309,7 @@ function validateBlockNumbers(results: { blockNumber: bigint }[]): BlockConflict
const blockStrs = blockNumbers.map((blockNumber) => blockNumber.toString())
const uniqBlocks = uniq(blockStrs)

if (uniqBlocks.length === 1) {
if (uniqBlocks.length > 0 && uniqBlocks.length <= tolerance) {
return null
}

Expand Down

0 comments on commit 5823a04

Please sign in to comment.