From a315f6d84110f030aa7f001bc56ca0a0c9ccdaa0 Mon Sep 17 00:00:00 2001 From: mantikoros Date: Fri, 4 Mar 2022 10:58:15 -0500 Subject: [PATCH] fix antes --- common/antes.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/antes.ts b/common/antes.ts index a608da9d..7bea2740 100644 --- a/common/antes.ts +++ b/common/antes.ts @@ -9,10 +9,10 @@ export const MINIMUM_ANTE = 10 export const calcStartCpmmPool = (initialProbInt: number, ante: number) => { const p = initialProbInt / 100.0 - const invP = 1.0 / p - 1 - const otherAnte = ante / invP - const [poolYes, poolNo] = p >= 0.5 ? [otherAnte, ante] : [ante, otherAnte] + const [poolYes, poolNo] = + p >= 0.5 ? [ante * (1 / p - 1), ante] : [ante, ante * (1 / (1 - p) - 1)] + const k = poolYes * poolNo return { poolYes, poolNo, k }