Revert "use geometric mean probability to calculate fees for cfmm (a lot easier than solving the integral)"

This reverts commit a1c3a5e569.
This commit is contained in:
mantikoros 2022-05-24 15:46:41 -05:00
parent c3be126337
commit 5f385c2f9d

View File

@ -63,10 +63,8 @@ export function getCpmmLiquidityFee(
bet: number, bet: number,
outcome: string outcome: string
) { ) {
const probBefore = getCpmmProbability(contract.pool, contract.p) const prob = getCpmmProbabilityAfterBetBeforeFees(contract, outcome, bet)
const probAfter = getCpmmProbabilityAfterBetBeforeFees(contract, outcome, bet) const betP = outcome === 'YES' ? 1 - prob : prob
const probMid = Math.sqrt(probBefore * probAfter)
const betP = outcome === 'YES' ? 1 - probMid : probMid
const liquidityFee = LIQUIDITY_FEE * betP * bet const liquidityFee = LIQUIDITY_FEE * betP * bet
const platformFee = PLATFORM_FEE * betP * bet const platformFee = PLATFORM_FEE * betP * bet