bump sizeAdjustedSlippage for majors

This commit is contained in:
Nick Caradonna
2025-10-23 12:36:54 -04:00
parent 557ab75577
commit 1a5cf3bd95

View File

@@ -1440,12 +1440,17 @@ export const calculateDynamicSlippage = (
// use halfway to worst price as size adjusted slippage
if (startPrice && worstPrice) {
const sizeAdjustedSlippage =
let sizeAdjustedSlippage =
(startPrice.sub(worstPrice).abs().toNumber() /
BN.max(startPrice, worstPrice).toNumber() /
2) *
100;
if (isMajor) {
// add additional size adjusted multiplier for majors
sizeAdjustedSlippage = sizeAdjustedSlippage * 1.2;
}
dynamicSlippage = Math.max(dynamicSlippage, sizeAdjustedSlippage);
}