diff --git a/web/components/contracts-list.tsx b/web/components/contracts-list.tsx index 0a294e54..0c45da1c 100644 --- a/web/components/contracts-list.tsx +++ b/web/components/contracts-list.tsx @@ -7,7 +7,6 @@ import { contractMetrics, Contract, listContracts, - getBinaryProbPercent, getBinaryProb, } from '../lib/firebase/contracts' import { User } from '../lib/firebase/users' @@ -16,7 +15,6 @@ import { SiteLink } from './site-link' import { ContractCard } from './contract-card' import { Sort, useQueryAndSortParams } from '../hooks/use-sort-and-query-params' import { Answer } from '../../common/answer' -import { getProbability } from '../../common/calculate' export function ContractsGrid(props: { contracts: Contract[] @@ -249,9 +247,7 @@ export function SearchableGrid(props: { ({ closeTime }) => closeTime && closeTime > Date.now() !== hideClosed ) } else if (sort === 'most-traded') { - matches.sort( - (a, b) => contractMetrics(b).truePool - contractMetrics(a).truePool - ) + matches.sort((a, b) => b.volume - a.volume) } else if (sort === '24-hour-vol') { // Use lodash for stable sort, so previous sort breaks all ties. matches = _.sortBy(matches, ({ volume7Days }) => -1 * volume7Days) diff --git a/web/lib/firebase/contracts.ts b/web/lib/firebase/contracts.ts index 41f94e65..46474c3f 100644 --- a/web/lib/firebase/contracts.ts +++ b/web/lib/firebase/contracts.ts @@ -29,9 +29,7 @@ export function contractPath(contract: Contract) { } export function contractMetrics(contract: Contract) { - const { pool, createdTime, resolutionTime, isResolved } = contract - - const truePool = _.sum(Object.values(pool)) + const { createdTime, resolutionTime, isResolved } = contract const createdDate = dayjs(createdTime).format('MMM D') @@ -41,7 +39,7 @@ export function contractMetrics(contract: Contract) { const volumeLabel = `${formatMoney(contract.volume)} volume` - return { truePool, volumeLabel, createdDate, resolvedDate } + return { volumeLabel, createdDate, resolvedDate } } export function getBinaryProb(contract: FullContract) {