Kill dead code
This commit is contained in:
parent
5f3253966e
commit
f2e52cfcb2
|
@ -1,5 +1,4 @@
|
||||||
import { range } from 'lodash'
|
import { range } from 'lodash'
|
||||||
import { PHANTOM_ANTE } from './antes'
|
|
||||||
import {
|
import {
|
||||||
Binary,
|
Binary,
|
||||||
Contract,
|
Contract,
|
||||||
|
@ -12,7 +11,6 @@ import {
|
||||||
import { User } from './user'
|
import { User } from './user'
|
||||||
import { parseTags } from './util/parse'
|
import { parseTags } from './util/parse'
|
||||||
import { removeUndefinedProps } from './util/object'
|
import { removeUndefinedProps } from './util/object'
|
||||||
import { calcDpmInitialPool } from './calculate-dpm'
|
|
||||||
|
|
||||||
export function getNewContract(
|
export function getNewContract(
|
||||||
id: string,
|
id: string,
|
||||||
|
@ -78,6 +76,9 @@ export function getNewContract(
|
||||||
return contract as Contract
|
return contract as Contract
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
import { PHANTOM_ANTE } from './antes'
|
||||||
|
import { calcDpmInitialPool } from './calculate-dpm'
|
||||||
const getBinaryDpmProps = (initialProb: number, ante: number) => {
|
const getBinaryDpmProps = (initialProb: number, ante: number) => {
|
||||||
const { sharesYes, sharesNo, poolYes, poolNo, phantomYes, phantomNo } =
|
const { sharesYes, sharesNo, poolYes, poolNo, phantomYes, phantomNo } =
|
||||||
calcDpmInitialPool(initialProb, ante, PHANTOM_ANTE)
|
calcDpmInitialPool(initialProb, ante, PHANTOM_ANTE)
|
||||||
|
@ -94,6 +95,7 @@ const getBinaryDpmProps = (initialProb: number, ante: number) => {
|
||||||
|
|
||||||
return system
|
return system
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
const getBinaryCpmmProps = (initialProb: number, ante: number) => {
|
const getBinaryCpmmProps = (initialProb: number, ante: number) => {
|
||||||
const pool = { YES: ante, NO: ante }
|
const pool = { YES: ante, NO: ante }
|
||||||
|
@ -154,11 +156,3 @@ const getNumericProps = (
|
||||||
|
|
||||||
return system
|
return system
|
||||||
}
|
}
|
||||||
|
|
||||||
const getMultiProps = (
|
|
||||||
outcomes: string[],
|
|
||||||
initialProbs: number[],
|
|
||||||
ante: number
|
|
||||||
) => {
|
|
||||||
// Not implemented.
|
|
||||||
}
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { Bet } from './bet'
|
||||||
import { Binary, Contract, FullContract } from './contract'
|
import { Binary, Contract, FullContract } from './contract'
|
||||||
import { getPayouts } from './payouts'
|
import { getPayouts } from './payouts'
|
||||||
|
|
||||||
export function scoreCreators(contracts: Contract[], bets: Bet[][]) {
|
export function scoreCreators(contracts: Contract[]) {
|
||||||
const creatorScore = mapValues(
|
const creatorScore = mapValues(
|
||||||
groupBy(contracts, ({ creatorId }) => creatorId),
|
groupBy(contracts, ({ creatorId }) => creatorId),
|
||||||
(contracts) => sumBy(contracts, ({ pool }) => pool.YES + pool.NO)
|
(contracts) => sumBy(contracts, ({ pool }) => pool.YES + pool.NO)
|
||||||
|
|
|
@ -54,7 +54,7 @@ export async function getStaticPropz(props: { params: { slugs: string[] } }) {
|
||||||
)
|
)
|
||||||
activeContracts = [...unresolved, ...resolved]
|
activeContracts = [...unresolved, ...resolved]
|
||||||
|
|
||||||
const creatorScores = scoreCreators(contracts, bets)
|
const creatorScores = scoreCreators(contracts)
|
||||||
const traderScores = scoreTraders(contracts, bets)
|
const traderScores = scoreTraders(contracts, bets)
|
||||||
const [topCreators, topTraders] = await Promise.all([
|
const [topCreators, topTraders] = await Promise.all([
|
||||||
toTopUsers(creatorScores),
|
toTopUsers(creatorScores),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user