Resolve emails include full payout not subtracting loan
This commit is contained in:
parent
42533c296a
commit
d5ae4a2377
|
@ -115,6 +115,11 @@ export const resolveMarket = functions
|
||||||
_.sumBy(group, (g) => g.payout)
|
_.sumBy(group, (g) => g.payout)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const groupsWithoutLoans = _.groupBy(payouts, (payout) => payout.userId)
|
||||||
|
const userPayoutsWithoutLoans = _.mapValues(groupsWithoutLoans, (group) =>
|
||||||
|
_.sumBy(group, (g) => g.payout)
|
||||||
|
)
|
||||||
|
|
||||||
const payoutPromises = Object.entries(userPayouts).map(
|
const payoutPromises = Object.entries(userPayouts).map(
|
||||||
([userId, payout]) => payUser(userId, payout)
|
([userId, payout]) => payUser(userId, payout)
|
||||||
)
|
)
|
||||||
|
@ -125,7 +130,7 @@ export const resolveMarket = functions
|
||||||
|
|
||||||
await sendResolutionEmails(
|
await sendResolutionEmails(
|
||||||
openBets,
|
openBets,
|
||||||
userPayouts,
|
userPayoutsWithoutLoans,
|
||||||
creator,
|
creator,
|
||||||
contract,
|
contract,
|
||||||
outcome,
|
outcome,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user