This commit is contained in:
github-actions[bot] 2022-10-08 17:17:10 +00:00 committed by GitHub
commit 14003c1ad8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -97,7 +97,11 @@ export const computeBinaryCpmmElasticity = (
) )
const resultNo = getCpmmProbability(poolN, pN) const resultNo = getCpmmProbability(poolN, pN)
return resultYes - resultNo // handle AMM overflow
const safeYes = Number.isFinite(resultYes) ? resultYes : 1
const safeNo = Number.isFinite(resultNo) ? resultNo : 0
return safeYes - safeNo
} }
export const computeDpmElasticity = ( export const computeDpmElasticity = (

View File

@ -169,7 +169,7 @@ export async function updateMetricsCore() {
return 0 return 0
} }
const contractRatio = const contractRatio =
contract.flaggedByUsernames.length / (contract.uniqueBettorCount ?? 1) contract.flaggedByUsernames.length / (contract.uniqueBettorCount || 1)
return contractRatio return contractRatio
}) })