Fix loan amount label to account for sales.

This commit is contained in:
James Grugett 2022-03-17 12:04:44 -05:00
parent f14a87c9b3
commit e0989bdfde

View File

@ -437,7 +437,10 @@ export function ContractBetsTable(props: {
-0.5 * _.sumBy(redemptions, (b) => b.shares) -0.5 * _.sumBy(redemptions, (b) => b.shares)
) )
const amountLoaned = _.sumBy(bets, (bet) => bet.loanAmount ?? 0) const amountLoaned = _.sumBy(
bets.filter((bet) => !bet.isSold && !bet.sale),
(bet) => bet.loanAmount ?? 0
)
const { isResolved, mechanism } = contract const { isResolved, mechanism } = contract
const isCPMM = mechanism === 'cpmm-1' const isCPMM = mechanism === 'cpmm-1'