From f2e52cfcb2c988eaf31c89765b78d5599b2bf6c9 Mon Sep 17 00:00:00 2001 From: Marshall Polaris Date: Tue, 24 May 2022 13:24:43 -0700 Subject: [PATCH] Kill dead code --- common/new-contract.ts | 14 ++++---------- common/scoring.ts | 2 +- web/pages/fold/[...slugs]/index.tsx | 2 +- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/common/new-contract.ts b/common/new-contract.ts index d658a943..b70dee37 100644 --- a/common/new-contract.ts +++ b/common/new-contract.ts @@ -1,5 +1,4 @@ import { range } from 'lodash' -import { PHANTOM_ANTE } from './antes' import { Binary, Contract, @@ -12,7 +11,6 @@ import { import { User } from './user' import { parseTags } from './util/parse' import { removeUndefinedProps } from './util/object' -import { calcDpmInitialPool } from './calculate-dpm' export function getNewContract( id: string, @@ -78,6 +76,9 @@ export function getNewContract( return contract as Contract } +/* +import { PHANTOM_ANTE } from './antes' +import { calcDpmInitialPool } from './calculate-dpm' const getBinaryDpmProps = (initialProb: number, ante: number) => { const { sharesYes, sharesNo, poolYes, poolNo, phantomYes, phantomNo } = calcDpmInitialPool(initialProb, ante, PHANTOM_ANTE) @@ -94,6 +95,7 @@ const getBinaryDpmProps = (initialProb: number, ante: number) => { return system } +*/ const getBinaryCpmmProps = (initialProb: number, ante: number) => { const pool = { YES: ante, NO: ante } @@ -154,11 +156,3 @@ const getNumericProps = ( return system } - -const getMultiProps = ( - outcomes: string[], - initialProbs: number[], - ante: number -) => { - // Not implemented. -} diff --git a/common/scoring.ts b/common/scoring.ts index d4855851..3f0c44b6 100644 --- a/common/scoring.ts +++ b/common/scoring.ts @@ -4,7 +4,7 @@ import { Bet } from './bet' import { Binary, Contract, FullContract } from './contract' import { getPayouts } from './payouts' -export function scoreCreators(contracts: Contract[], bets: Bet[][]) { +export function scoreCreators(contracts: Contract[]) { const creatorScore = mapValues( groupBy(contracts, ({ creatorId }) => creatorId), (contracts) => sumBy(contracts, ({ pool }) => pool.YES + pool.NO) diff --git a/web/pages/fold/[...slugs]/index.tsx b/web/pages/fold/[...slugs]/index.tsx index ad286d60..095cf274 100644 --- a/web/pages/fold/[...slugs]/index.tsx +++ b/web/pages/fold/[...slugs]/index.tsx @@ -54,7 +54,7 @@ export async function getStaticPropz(props: { params: { slugs: string[] } }) { ) activeContracts = [...unresolved, ...resolved] - const creatorScores = scoreCreators(contracts, bets) + const creatorScores = scoreCreators(contracts) const traderScores = scoreTraders(contracts, bets) const [topCreators, topTraders] = await Promise.all([ toTopUsers(creatorScores),