Don't include loans in email payout message

This commit is contained in:
James Grugett 2022-10-13 16:05:40 -05:00
parent 903fcc83b3
commit 47eb8abed0

View File

@ -171,12 +171,12 @@ export const resolveMarket = async (
const openBets = bets.filter((b) => !b.isSold && !b.sale)
const loanPayouts = getLoanPayouts(openBets)
const payouts = [
const payoutsWithoutLoans = [
{ userId: creatorId, payout: creatorPayout, deposit: creatorPayout },
...liquidityPayouts.map((p) => ({ ...p, deposit: p.payout })),
...traderPayouts,
...loanPayouts,
]
const payouts = [...payoutsWithoutLoans, ...loanPayouts]
if (!isProd())
console.log(
@ -208,7 +208,7 @@ export const resolveMarket = async (
await undoUniqueBettorRewardsIfCancelResolution(contract, outcome)
await revalidateStaticProps(getContractPath(contract))
const userPayoutsWithoutLoans = groupPayoutsByUser(payouts)
const userPayoutsWithoutLoans = groupPayoutsByUser(payoutsWithoutLoans)
const userInvestments = mapValues(
groupBy(bets, (bet) => bet.userId),