Skip to content

Commit

Permalink
Fixes for cpmm-2 payouts (deprecated multi-choice)
Browse files Browse the repository at this point in the history
  • Loading branch information
jahooma committed Jan 5, 2023
1 parent 78fa030 commit 1fdf495
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion common/payouts-fixed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const getMktFixedPayouts = (
return { YES: p, NO: 1 - p }
}

if (resolutionProbs) return resolutionProbs
if (resolutionProbs) return mapValues(resolutionProbs, (p) => p / 100)
return mapValues(contract.pool, (_, o) =>
getOutcomeProbability(contract, o)
)
Expand Down
8 changes: 8 additions & 0 deletions common/payouts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ export const getFixedPayouts = (
)
default:
case 'CANCEL':
if (contract.mechanism === 'cpmm-2' && outcome !== 'CANCEL')
return getStandardFixedPayouts(
outcome ?? '',
contract,
bets,
liquidities
)

return getFixedCancelPayouts(bets, liquidities)
}
}
Expand Down

0 comments on commit 1fdf495

Please sign in to comment.