Skip to content

Commit

Permalink
feat: make fillPrice slightly worse to account for the fee
Browse files Browse the repository at this point in the history
  • Loading branch information
alfetopito committed Jan 20, 2025
1 parent 13033d7 commit cdfbb0b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/cowswap-frontend/src/legacy/state/orders/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,12 @@ export function getEstimatedExecutionPrice(
})
}

// // Make the fill price a bit worse to account for the fee
const newFillPrice =
extrapolatePriceBasedOnFeeAmount(feeAmount, remainingSellAmount, fillPrice, inputToken, outputToken) || fillPrice

// Pick the MAX between FEP and FP
return fillPrice.greaterThan(feasibleExecutionPrice) ? fillPrice : feasibleExecutionPrice
return newFillPrice.greaterThan(feasibleExecutionPrice) ? newFillPrice : feasibleExecutionPrice
}

/**
Expand Down

0 comments on commit cdfbb0b

Please sign in to comment.