diff --git a/common/src/calculate-cpmm-arbitrage.ts b/common/src/calculate-cpmm-arbitrage.ts index c312436b2f..3a560a5b00 100644 --- a/common/src/calculate-cpmm-arbitrage.ts +++ b/common/src/calculate-cpmm-arbitrage.ts @@ -52,7 +52,10 @@ export function calculateCpmmMultiArbitrageBet( : MIN_CPMM_PROB if ( (answerToBuy.prob < MIN_CPMM_PROB && outcome === 'NO') || - (answerToBuy.prob > MAX_CPMM_PROB && outcome === 'YES') + (answerToBuy.prob > MAX_CPMM_PROB && outcome === 'YES') || + // Fixes limit order fills at current price when limitProb is set to a diff price and user has shares to redeem + (answerToBuy.prob > limitProb && outcome === 'YES') || + (answerToBuy.prob < limitProb && outcome === 'NO') ) { return noFillsReturn(outcome, answerToBuy, collectedFees) }