Skip to content

Commit

Permalink
Fix one instance of small limit order fills at wrong price
Browse files Browse the repository at this point in the history
  • Loading branch information
IanPhilips committed Sep 16, 2024
1 parent 22edf57 commit f7d565a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion common/src/calculate-cpmm-arbitrage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit f7d565a

Please sign in to comment.