small fixes
This commit is contained in:
parent
8df7b0fbe6
commit
82b66a8d53
|
@ -4,6 +4,7 @@ import { getCpmmLiquidity, 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'
|
||||||
import { LiquidityProvision } from './liquidity-provision'
|
import { LiquidityProvision } from './liquidity-provision'
|
||||||
|
import { noFees } from './fees'
|
||||||
|
|
||||||
export const PHANTOM_ANTE = 0.001
|
export const PHANTOM_ANTE = 0.001
|
||||||
export const MINIMUM_ANTE = 10
|
export const MINIMUM_ANTE = 10
|
||||||
|
@ -30,6 +31,7 @@ export function getCpmmAnteBet(
|
||||||
probAfter: p,
|
probAfter: p,
|
||||||
createdTime,
|
createdTime,
|
||||||
isAnte: true,
|
isAnte: true,
|
||||||
|
fees: noFees,
|
||||||
}
|
}
|
||||||
|
|
||||||
return bet
|
return bet
|
||||||
|
@ -80,6 +82,7 @@ export function getAnteBets(
|
||||||
probAfter: p,
|
probAfter: p,
|
||||||
createdTime,
|
createdTime,
|
||||||
isAnte: true,
|
isAnte: true,
|
||||||
|
fees: noFees,
|
||||||
}
|
}
|
||||||
|
|
||||||
const noBet: Bet = {
|
const noBet: Bet = {
|
||||||
|
@ -93,6 +96,7 @@ export function getAnteBets(
|
||||||
probAfter: p,
|
probAfter: p,
|
||||||
createdTime,
|
createdTime,
|
||||||
isAnte: true,
|
isAnte: true,
|
||||||
|
fees: noFees,
|
||||||
}
|
}
|
||||||
|
|
||||||
return { yesBet, noBet }
|
return { yesBet, noBet }
|
||||||
|
@ -120,6 +124,7 @@ export function getFreeAnswerAnte(
|
||||||
probAfter: 1,
|
probAfter: 1,
|
||||||
createdTime,
|
createdTime,
|
||||||
isAnte: true,
|
isAnte: true,
|
||||||
|
fees: noFees,
|
||||||
}
|
}
|
||||||
|
|
||||||
return anteBet
|
return anteBet
|
||||||
|
|
|
@ -69,7 +69,7 @@ export function calculateShares(
|
||||||
|
|
||||||
export function calculateSaleAmount(contract: Contract, bet: Bet) {
|
export function calculateSaleAmount(contract: Contract, bet: Bet) {
|
||||||
return contract.mechanism === 'cpmm-1' && contract.outcomeType === 'BINARY'
|
return contract.mechanism === 'cpmm-1' && contract.outcomeType === 'BINARY'
|
||||||
? calculateCpmmSale(contract, bet)
|
? calculateCpmmSale(contract, bet).saleValue
|
||||||
: calculateDpmSaleAmount(contract, bet)
|
: calculateDpmSaleAmount(contract, bet)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,9 @@ export function scoreUsersByContract(
|
||||||
bets,
|
bets,
|
||||||
(bet) => bet.isSold || bet.sale
|
(bet) => bet.isSold || bet.sale
|
||||||
)
|
)
|
||||||
const resolvePayouts = getPayouts(
|
const [resolvePayouts] = getPayouts(
|
||||||
resolution ?? 'MKT',
|
resolution,
|
||||||
|
{},
|
||||||
contract,
|
contract,
|
||||||
openBets,
|
openBets,
|
||||||
[],
|
[],
|
||||||
|
|
|
@ -476,8 +476,6 @@ function BetRow(props: { bet: Bet; contract: Contract; saleBet?: Bet }) {
|
||||||
shares,
|
shares,
|
||||||
isSold,
|
isSold,
|
||||||
isAnte,
|
isAnte,
|
||||||
isLiquidityProvision,
|
|
||||||
isRedemption,
|
|
||||||
loanAmount,
|
loanAmount,
|
||||||
} = bet
|
} = bet
|
||||||
|
|
||||||
|
@ -512,9 +510,6 @@ function BetRow(props: { bet: Bet; contract: Contract; saleBet?: Bet }) {
|
||||||
{!isCPMM && !isResolved && !isClosed && !isSold && !isAnte && (
|
{!isCPMM && !isResolved && !isClosed && !isSold && !isAnte && (
|
||||||
<SellButton contract={contract} bet={bet} />
|
<SellButton contract={contract} bet={bet} />
|
||||||
)}
|
)}
|
||||||
{/* {isAnte && 'ANTE'}
|
|
||||||
{isLiquidityProvision && !isAnte && 'LIQD'}
|
|
||||||
{isRedemption && 'REDEEM'} */}
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<OutcomeLabel outcome={outcome} />
|
<OutcomeLabel outcome={outcome} />
|
||||||
|
|
Loading…
Reference in New Issue
Block a user