Kill dead code

This commit is contained in:
Marshall Polaris 2022-05-24 13:24:43 -07:00
parent 5f3253966e
commit f2e52cfcb2
3 changed files with 6 additions and 12 deletions

View File

@ -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.
}

View File

@ -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)

View File

@ -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),