moved calculate ts for access in firebase

This commit is contained in:
Milli 2022-06-05 18:23:21 +02:00
parent e0bdc70843
commit 8380bf4f72
4 changed files with 12 additions and 8 deletions

View File

@ -1,12 +1,12 @@
import { maxBy } from 'lodash'
import { Bet } from './bet'
import { Bet } from '../../common/bet'
import {
calculateCpmmSale,
getCpmmProbability,
getCpmmOutcomeProbabilityAfterBet,
getCpmmProbabilityAfterSale,
calculateCpmmSharesAfterFee,
} from './calculate-cpmm'
} from '../../common/calculate-cpmm'
import {
calculateDpmPayout,
calculateDpmPayoutAfterCorrectBet,
@ -16,9 +16,13 @@ import {
getDpmProbability,
getDpmOutcomeProbabilityAfterBet,
getDpmProbabilityAfterSale,
} from './calculate-dpm'
import { calculateFixedPayout } from './calculate-fixed-payouts'
import { Contract, BinaryContract, FreeResponseContract } from './contract'
} from '../../common/calculate-dpm'
import { calculateFixedPayout } from '../../common/calculate-fixed-payouts'
import {
Contract,
BinaryContract,
FreeResponseContract,
} from '../../common/contract'
export function getProbability(contract: BinaryContract) {
return contract.mechanism === 'cpmm-1'

View File

@ -17,7 +17,7 @@ import { removeUndefinedProps } from '../../common/util/object'
import { LiquidityProvision } from '../../common/liquidity-provision'
import { getValues } from './utils'
import { batchedWaitAll } from '../../common/util/promise'
import { getProbability } from 'common/calculate'
import { getProbability } from '../shared/calculate'
export const resolveMarket = functions
.runWith({ minInstances: 1 })

View File

@ -44,7 +44,7 @@ import {
getContractBetMetrics,
resolvedPayout,
getContractBetNullMetrics,
} from 'common/calculate'
} from 'functions/shared/calculate'
import { useTimeSinceFirstRender } from 'web/hooks/use-time-since-first-render'
import { trackLatency } from 'web/lib/firebase/tracking'
import { NumericContract } from 'common/contract'

View File

@ -9,7 +9,7 @@ import { ResolveConfirmationButton } from './confirmation-button'
import { resolveMarket } from 'web/lib/firebase/fn-call'
import { ProbabilitySelector } from './probability-selector'
import { DPM_CREATOR_FEE } from 'common/fees'
import { getProbability } from 'common/calculate'
import { getProbability } from 'functions/shared/calculate'
import { BinaryContract, resolution } from 'common/contract'
import { formatMoney } from 'common/util/format'