Skip to content

Commit

Permalink
Auto-prettification
Browse files Browse the repository at this point in the history
  • Loading branch information
mantikoros authored and github-actions[bot] committed Feb 22, 2024
1 parent 79f6bd6 commit 7f83baa
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions web/pages/[username]/calibration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,17 +213,24 @@ const getCalibrationPoints = (betsData: [Contract, LimitBet[]][]) => {
const nextPosition = currentPosition + bet.shares * betSign

// skip explicit and exclusive implicit sales
if (bet.amount < 0 || ((Math.sign(currentPosition) !== betSign) && (Math.abs(currentPosition) >= Math.abs(bet.shares)))) {
currentPosition = nextPosition // update position before continuing
if (
bet.amount < 0 ||
(Math.sign(currentPosition) !== betSign &&
Math.abs(currentPosition) >= Math.abs(bet.shares))
) {
currentPosition = nextPosition // update position before continuing
continue
}

// set bet weight, adjusted for any partial implicit sale
let w = bet.shares
if (Math.sign(currentPosition) !== betSign && Math.abs(currentPosition) < Math.abs(bet.shares)) {
if (
Math.sign(currentPosition) !== betSign &&
Math.abs(currentPosition) < Math.abs(bet.shares)
) {
w = Math.abs(nextPosition)
}

currentPosition = nextPosition // update position

const rawP = bet.probAfter * 100
Expand Down

0 comments on commit 7f83baa

Please sign in to comment.