rename 'calculate.ts' => 'calculate-dpm.ts'

This commit is contained in:
mantikoros 2022-03-02 22:20:35 -05:00
parent d91abf4faf
commit e80926d201
21 changed files with 24 additions and 20 deletions

View File

@ -1,5 +1,5 @@
import { Bet } from './bet' import { Bet } from './bet'
import { getProbability } from './calculate' import { getProbability } from './calculate-dpm'
import { getCpmmProbability } from './calculate-cpmm' import { getCpmmProbability } from './calculate-cpmm'
import { Binary, CPMM, DPM, FreeResponse, FullContract } from './contract' import { Binary, CPMM, DPM, FreeResponse, FullContract } from './contract'
import { User } from './user' import { User } from './user'

View File

@ -4,7 +4,7 @@ import {
calculateShares, calculateShares,
getProbability, getProbability,
getOutcomeProbability, getOutcomeProbability,
} from './calculate' } from './calculate-dpm'
import { calculateCpmmShares, getCpmmProbability } from './calculate-cpmm' import { calculateCpmmShares, getCpmmProbability } from './calculate-cpmm'
import { import {
Binary, Binary,

View File

@ -1,7 +1,7 @@
import * as _ from 'lodash' import * as _ from 'lodash'
import { Bet } from './bet' import { Bet } from './bet'
import { deductFees, getProbability } from './calculate' import { deductFees, getProbability } from './calculate-dpm'
import { import {
Binary, Binary,
Contract, Contract,

View File

@ -1,5 +1,9 @@
import { Bet } from './bet' import { Bet } from './bet'
import { calculateShareValue, deductFees, getProbability } from './calculate' import {
calculateShareValue,
deductFees,
getProbability,
} from './calculate-dpm'
import { import {
calculateCpmmSale, calculateCpmmSale,
calculateCpmmShareValue, calculateCpmmShareValue,

View File

@ -1,7 +1,7 @@
import _ = require('lodash') import _ = require('lodash')
import { Answer } from '../../common/answer' import { Answer } from '../../common/answer'
import { Bet } from '../../common/bet' import { Bet } from '../../common/bet'
import { getProbability } from '../../common/calculate' import { getProbability } from '../../common/calculate-dpm'
import { Comment } from '../../common/comment' import { Comment } from '../../common/comment'
import { Contract } from '../../common/contract' import { Contract } from '../../common/contract'
import { CREATOR_FEE } from '../../common/fees' import { CREATOR_FEE } from '../../common/fees'

View File

@ -4,7 +4,7 @@ import * as _ from 'lodash'
import { getValues } from './utils' import { getValues } from './utils'
import { Contract } from '../../common/contract' import { Contract } from '../../common/contract'
import { getProbability } from '../../common/calculate' import { getProbability } from '../../common/calculate-dpm'
const cache = { lastUpdated: 0, data: '' } const cache = { lastUpdated: 0, data: '' }

View File

@ -5,7 +5,7 @@ import { initAdmin } from './script-init'
initAdmin('stephen') initAdmin('stephen')
import { Bet } from '../../../common/bet' import { Bet } from '../../../common/bet'
import { getProbability } from '../../../common/calculate' import { getProbability } from '../../../common/calculate-dpm'
import { Contract } from '../../../common/contract' import { Contract } from '../../../common/contract'
type DocRef = admin.firestore.DocumentReference type DocRef = admin.firestore.DocumentReference

View File

@ -6,7 +6,7 @@ initAdmin('stephenDev')
import { Contract } from '../../../common/contract' import { Contract } from '../../../common/contract'
import { Bet } from '../../../common/bet' import { Bet } from '../../../common/bet'
import { calculateShares, getProbability } from '../../../common/calculate' import { calculateShares, getProbability } from '../../../common/calculate-dpm'
import { getSellBetInfo } from '../../../common/sell-bet' import { getSellBetInfo } from '../../../common/sell-bet'
import { User } from '../../../common/user' import { User } from '../../../common/user'

View File

@ -6,7 +6,7 @@ import { getValues } from './utils'
import { Contract } from '../../common/contract' import { Contract } from '../../common/contract'
import { Bet } from '../../common/bet' import { Bet } from '../../common/bet'
import { User } from '../../common/user' import { User } from '../../common/user'
import { calculatePayout } from '../../common/calculate' import { calculatePayout } from '../../common/calculate-dpm'
const firestore = admin.firestore() const firestore = admin.firestore()

View File

@ -22,7 +22,7 @@ import {
getOutcomeProbability, getOutcomeProbability,
calculateShares, calculateShares,
calculatePayoutAfterCorrectBet, calculatePayoutAfterCorrectBet,
} from '../../../common/calculate' } from '../../../common/calculate-dpm'
import { firebaseLogin } from '../../lib/firebase/users' import { firebaseLogin } from '../../lib/firebase/users'
import { Bet } from '../../../common/bet' import { Bet } from '../../../common/bet'

View File

@ -10,7 +10,7 @@ import { Avatar } from '../avatar'
import { SiteLink } from '../site-link' import { SiteLink } from '../site-link'
import { BuyButton } from '../yes-no-selector' import { BuyButton } from '../yes-no-selector'
import { formatPercent } from '../../../common/util/format' import { formatPercent } from '../../../common/util/format'
import { getOutcomeProbability } from '../../../common/calculate' import { getOutcomeProbability } from '../../../common/calculate-dpm'
import { tradingAllowed } from '../../lib/firebase/contracts' import { tradingAllowed } from '../../lib/firebase/contracts'
import { AnswerBetPanel } from './answer-bet-panel' import { AnswerBetPanel } from './answer-bet-panel'
import { ContractFeed } from '../contract-feed' import { ContractFeed } from '../contract-feed'

View File

@ -6,7 +6,7 @@ import { DPM, FreeResponse, FullContract } from '../../../common/contract'
import { Col } from '../layout/col' import { Col } from '../layout/col'
import { formatPercent } from '../../../common/util/format' import { formatPercent } from '../../../common/util/format'
import { useUser } from '../../hooks/use-user' import { useUser } from '../../hooks/use-user'
import { getOutcomeProbability } from '../../../common/calculate' import { getOutcomeProbability } from '../../../common/calculate-dpm'
import { useAnswers } from '../../hooks/use-answers' import { useAnswers } from '../../hooks/use-answers'
import { tradingAllowed } from '../../lib/firebase/contracts' import { tradingAllowed } from '../../lib/firebase/contracts'
import { AnswerItem } from './answer-item' import { AnswerItem } from './answer-item'

View File

@ -24,7 +24,7 @@ import {
getProbabilityAfterBet, getProbabilityAfterBet,
calculateShares, calculateShares,
calculatePayoutAfterCorrectBet, calculatePayoutAfterCorrectBet,
} from '../../../common/calculate' } from '../../../common/calculate-dpm'
import { firebaseLogin } from '../../lib/firebase/users' import { firebaseLogin } from '../../lib/firebase/users'
import { Bet } from '../../../common/bet' import { Bet } from '../../../common/bet'

View File

@ -18,7 +18,7 @@ import {
calculateShares, calculateShares,
getProbabilityAfterBet, getProbabilityAfterBet,
calculatePayoutAfterCorrectBet, calculatePayoutAfterCorrectBet,
} from '../../common/calculate' } from '../../common/calculate-dpm'
import { firebaseLogin } from '../lib/firebase/users' import { firebaseLogin } from '../lib/firebase/users'
import { Bet } from '../../common/bet' import { Bet } from '../../common/bet'
import { placeBet } from '../lib/firebase/api-call' import { placeBet } from '../lib/firebase/api-call'

View File

@ -29,7 +29,7 @@ import {
getProbability, getProbability,
getProbabilityAfterSale, getProbabilityAfterSale,
resolvedPayout, resolvedPayout,
} from '../../common/calculate' } from '../../common/calculate-dpm'
import { sellBet } from '../lib/firebase/api-call' import { sellBet } from '../lib/firebase/api-call'
import { ConfirmationButton } from './confirmation-button' import { ConfirmationButton } from './confirmation-button'
import { OutcomeLabel, YesLabel, NoLabel } from './outcome-label' import { OutcomeLabel, YesLabel, NoLabel } from './outcome-label'

View File

@ -2,7 +2,7 @@ import { DatumValue } from '@nivo/core'
import { ResponsiveLine } from '@nivo/line' import { ResponsiveLine } from '@nivo/line'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { Bet } from '../../common/bet' import { Bet } from '../../common/bet'
import { getProbability } from '../../common/calculate' import { getProbability } from '../../common/calculate-dpm'
import { useBetsWithoutAntes } from '../hooks/use-bets' import { useBetsWithoutAntes } from '../hooks/use-bets'
import { useWindowSize } from '../hooks/use-window-size' import { useWindowSize } from '../hooks/use-window-size'
import { Contract } from '../lib/firebase/contracts' import { Contract } from '../lib/firebase/contracts'

View File

@ -10,7 +10,7 @@ import { Spacer } from './layout/spacer'
import { ResolveConfirmationButton } from './confirmation-button' import { ResolveConfirmationButton } from './confirmation-button'
import { resolveMarket } from '../lib/firebase/api-call' import { resolveMarket } from '../lib/firebase/api-call'
import { ProbabilitySelector } from './probability-selector' import { ProbabilitySelector } from './probability-selector'
import { getProbability } from '../../common/calculate' import { getProbability } from '../../common/calculate-dpm'
import { CREATOR_FEE } from '../../common/fees' import { CREATOR_FEE } from '../../common/fees'
export function ResolutionPanel(props: { export function ResolutionPanel(props: {

View File

@ -18,7 +18,7 @@ import _ from 'lodash'
import { app } from './init' import { app } from './init'
import { getValues, listenForValue, listenForValues } from './utils' import { getValues, listenForValue, listenForValues } from './utils'
import { Binary, Contract, FullContract } from '../../../common/contract' import { Binary, Contract, FullContract } from '../../../common/contract'
import { getProbability } from '../../../common/calculate' import { getProbability } from '../../../common/calculate-dpm'
import { createRNG, shuffle } from '../../../common/util/random' import { createRNG, shuffle } from '../../../common/util/random'
import { getCpmmProbability } from '../../../common/calculate-cpmm' import { getCpmmProbability } from '../../../common/calculate-cpmm'
export type { Contract } export type { Contract }

View File

@ -1,5 +1,5 @@
import { Bet } from '../../../../common/bet' import { Bet } from '../../../../common/bet'
import { getProbability } from '../../../../common/calculate' import { getProbability } from '../../../../common/calculate-dpm'
import { Comment } from '../../../../common/comment' import { Comment } from '../../../../common/comment'
import { Contract } from '../../../../common/contract' import { Contract } from '../../../../common/contract'

View File

@ -3,7 +3,7 @@ import dayjs from 'dayjs'
import Link from 'next/link' import Link from 'next/link'
import { useState } from 'react' import { useState } from 'react'
import Textarea from 'react-expanding-textarea' import Textarea from 'react-expanding-textarea'
import { getProbability } from '../../common/calculate' import { getProbability } from '../../common/calculate-dpm'
import { parseWordsAsTags } from '../../common/util/parse' import { parseWordsAsTags } from '../../common/util/parse'
import { AmountInput } from '../components/amount-input' import { AmountInput } from '../components/amount-input'
import { InfoTooltip } from '../components/info-tooltip' import { InfoTooltip } from '../components/info-tooltip'