small fixes

This commit is contained in:
mantikoros 2022-03-10 15:05:52 -06:00
parent 8df7b0fbe6
commit 82b66a8d53
4 changed files with 9 additions and 8 deletions

View File

@ -4,6 +4,7 @@ import { getCpmmLiquidity, getCpmmProbability } from './calculate-cpmm'
import { Binary, CPMM, DPM, FreeResponse, FullContract } from './contract'
import { User } from './user'
import { LiquidityProvision } from './liquidity-provision'
import { noFees } from './fees'
export const PHANTOM_ANTE = 0.001
export const MINIMUM_ANTE = 10
@ -30,6 +31,7 @@ export function getCpmmAnteBet(
probAfter: p,
createdTime,
isAnte: true,
fees: noFees,
}
return bet
@ -80,6 +82,7 @@ export function getAnteBets(
probAfter: p,
createdTime,
isAnte: true,
fees: noFees,
}
const noBet: Bet = {
@ -93,6 +96,7 @@ export function getAnteBets(
probAfter: p,
createdTime,
isAnte: true,
fees: noFees,
}
return { yesBet, noBet }
@ -120,6 +124,7 @@ export function getFreeAnswerAnte(
probAfter: 1,
createdTime,
isAnte: true,
fees: noFees,
}
return anteBet

View File

@ -69,7 +69,7 @@ export function calculateShares(
export function calculateSaleAmount(contract: Contract, bet: Bet) {
return contract.mechanism === 'cpmm-1' && contract.outcomeType === 'BINARY'
? calculateCpmmSale(contract, bet)
? calculateCpmmSale(contract, bet).saleValue
: calculateDpmSaleAmount(contract, bet)
}

View File

@ -34,8 +34,9 @@ export function scoreUsersByContract(
bets,
(bet) => bet.isSold || bet.sale
)
const resolvePayouts = getPayouts(
resolution ?? 'MKT',
const [resolvePayouts] = getPayouts(
resolution,
{},
contract,
openBets,
[],

View File

@ -476,8 +476,6 @@ function BetRow(props: { bet: Bet; contract: Contract; saleBet?: Bet }) {
shares,
isSold,
isAnte,
isLiquidityProvision,
isRedemption,
loanAmount,
} = bet
@ -512,9 +510,6 @@ function BetRow(props: { bet: Bet; contract: Contract; saleBet?: Bet }) {
{!isCPMM && !isResolved && !isClosed && !isSold && !isAnte && (
<SellButton contract={contract} bet={bet} />
)}
{/* {isAnte && 'ANTE'}
{isLiquidityProvision && !isAnte && 'LIQD'}
{isRedemption && 'REDEEM'} */}
</td>
<td>
<OutcomeLabel outcome={outcome} />