From 5f385c2f9dbf35642e33c72c484af54ac0ac3f9e Mon Sep 17 00:00:00 2001 From: mantikoros Date: Tue, 24 May 2022 15:46:41 -0500 Subject: [PATCH] Revert "use geometric mean probability to calculate fees for cfmm (a lot easier than solving the integral)" This reverts commit a1c3a5e5692f82d48a2ada852da2571c47bfebba. --- common/calculate-cpmm.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/common/calculate-cpmm.ts b/common/calculate-cpmm.ts index 6b14211d..4ced5b16 100644 --- a/common/calculate-cpmm.ts +++ b/common/calculate-cpmm.ts @@ -63,10 +63,8 @@ export function getCpmmLiquidityFee( bet: number, outcome: string ) { - const probBefore = getCpmmProbability(contract.pool, contract.p) - const probAfter = getCpmmProbabilityAfterBetBeforeFees(contract, outcome, bet) - const probMid = Math.sqrt(probBefore * probAfter) - const betP = outcome === 'YES' ? 1 - probMid : probMid + const prob = getCpmmProbabilityAfterBetBeforeFees(contract, outcome, bet) + const betP = outcome === 'YES' ? 1 - prob : prob const liquidityFee = LIQUIDITY_FEE * betP * bet const platformFee = PLATFORM_FEE * betP * bet