dpm: don't use weightedShareTotal

This commit is contained in:
mantikoros 2022-06-08 16:18:00 -05:00
parent b231d0968f
commit 52dd68303a

View File

@ -346,10 +346,6 @@ function calculateMktDpmPayout(contract: DPMContract, bet: Bet) {
probs = mapValues(totalShares, (shares) => shares ** 2 / squareSum) probs = mapValues(totalShares, (shares) => shares ** 2 / squareSum)
} }
const weightedShareTotal = sumBy(Object.keys(totalShares), (outcome) => {
return probs[outcome] * totalShares[outcome]
})
const { outcome, amount, shares } = bet const { outcome, amount, shares } = bet
const poolFrac = const poolFrac =
@ -359,7 +355,7 @@ function calculateMktDpmPayout(contract: DPMContract, bet: Bet) {
(outcome) => { (outcome) => {
return ( return (
(probs[outcome] * (bet as NumericBet).allOutcomeShares[outcome]) / (probs[outcome] * (bet as NumericBet).allOutcomeShares[outcome]) /
weightedShareTotal totalShares[outcome]
) )
} }
) )