Fix getBinaryProb when resolutionProbability is 0.
This commit is contained in:
parent
72a56b46fd
commit
87b54ff92e
|
@ -49,9 +49,12 @@ export function contractMetrics(contract: Contract) {
|
||||||
export function getBinaryProb(contract: FullContract<any, Binary>) {
|
export function getBinaryProb(contract: FullContract<any, Binary>) {
|
||||||
const { totalShares, pool, p, resolutionProbability, mechanism } = contract
|
const { totalShares, pool, p, resolutionProbability, mechanism } = contract
|
||||||
|
|
||||||
return resolutionProbability ?? mechanism === 'cpmm-1'
|
return (
|
||||||
? getCpmmProbability(pool, p)
|
resolutionProbability ??
|
||||||
: getDpmProbability(totalShares)
|
(mechanism === 'cpmm-1'
|
||||||
|
? getCpmmProbability(pool, p)
|
||||||
|
: getDpmProbability(totalShares))
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getBinaryProbPercent(contract: FullContract<any, Binary>) {
|
export function getBinaryProbPercent(contract: FullContract<any, Binary>) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user