show outcome '0'
This commit is contained in:
parent
adba5135e2
commit
ec2cf78cbf
|
@ -178,15 +178,22 @@ function formatTime(
|
||||||
return d.format(format)
|
return d.format(format)
|
||||||
}
|
}
|
||||||
|
|
||||||
const computeProbsByOutcome = (bets: Bet[], contract: FreeResponseContract | MultipleChoiceContract) => {
|
const computeProbsByOutcome = (
|
||||||
const { totalBets } = contract
|
bets: Bet[],
|
||||||
|
contract: FreeResponseContract | MultipleChoiceContract
|
||||||
|
) => {
|
||||||
|
const { totalBets, outcomeType } = contract
|
||||||
|
|
||||||
const betsByOutcome = groupBy(bets, (bet) => bet.outcome)
|
const betsByOutcome = groupBy(bets, (bet) => bet.outcome)
|
||||||
const outcomes = Object.keys(betsByOutcome).filter((outcome) => {
|
const outcomes = Object.keys(betsByOutcome).filter((outcome) => {
|
||||||
const maxProb = Math.max(
|
const maxProb = Math.max(
|
||||||
...betsByOutcome[outcome].map((bet) => bet.probAfter)
|
...betsByOutcome[outcome].map((bet) => bet.probAfter)
|
||||||
)
|
)
|
||||||
return outcome !== '0' && maxProb > 0.02 && totalBets[outcome] > 0.000000001
|
return (
|
||||||
|
(outcome !== '0' || outcomeType === 'MULTIPLE_CHOICE') &&
|
||||||
|
maxProb > 0.02 &&
|
||||||
|
totalBets[outcome] > 0.000000001
|
||||||
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
const trackedOutcomes = sortBy(
|
const trackedOutcomes = sortBy(
|
||||||
|
|
|
@ -35,7 +35,9 @@ export function AnswersPanel(props: {
|
||||||
const answers = useAnswers(contract.id) ?? contract.answers
|
const answers = useAnswers(contract.id) ?? contract.answers
|
||||||
const [winningAnswers, losingAnswers] = partition(
|
const [winningAnswers, losingAnswers] = partition(
|
||||||
answers.filter(
|
answers.filter(
|
||||||
(answer) => answer.id !== '0' && totalBets[answer.id] > 0.000000001
|
(answer) =>
|
||||||
|
(answer.id !== '0' || outcomeType === 'MULTIPLE_CHOICE') &&
|
||||||
|
totalBets[answer.id] > 0.000000001
|
||||||
),
|
),
|
||||||
(answer) =>
|
(answer) =>
|
||||||
answer.id === resolution || (resolutions && resolutions[answer.id])
|
answer.id === resolution || (resolutions && resolutions[answer.id])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user