From 65d54e99b2e0e7193303c369cb5fe38f5b923e46 Mon Sep 17 00:00:00 2001 From: Kevin Kwok Date: Sun, 8 May 2022 12:27:34 -0700 Subject: [PATCH] Adding "Most uncertain" sort for markets --- web/components/contract/contracts-list.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/components/contract/contracts-list.tsx b/web/components/contract/contracts-list.tsx index e84af1ea..ed1f1836 100644 --- a/web/components/contract/contracts-list.tsx +++ b/web/components/contract/contracts-list.tsx @@ -275,6 +275,8 @@ export function SearchableGrid(props: { matches.sort((a, b) => b.volume7Days - a.volume7Days) } else if (sort === 'most-likely') { matches = _.sortBy(matches, (contract) => -getBinaryProb(contract)) + } else if (sort === 'most-uncertain') { + matches = _.sortBy(matches, (contract) => Math.abs(getBinaryProb(contract) - 0.5)) } else if (sort === 'least-likely') { // Exclude non-binary contracts matches = matches.filter((contract) => getBinaryProb(contract) !== 0) @@ -316,6 +318,7 @@ export function SearchableGrid(props: { +