Skip to content

Commit

Permalink
Merge pull request #20 from Levana-Protocol/fix-winner-detection
Browse files Browse the repository at this point in the history
perp-4068 | properly detect winner (handle case of 0 outcome)
  • Loading branch information
lvn-rusty-dragon authored Sep 16, 2024
2 parents b0e3c3f + 36171ab commit 627d9a4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/api/queries/Market.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ const marketFromResponse = (response: ResponseMarket): Market => {
withdrawalFee: BigNumber(response.withdrawal_fee),
depositStopDate: new Nanoseconds(response.deposit_stop_date),
withdrawalStopDate: new Nanoseconds(response.withdrawal_stop_date),
winnerOutcome: response.winner ? outcomes.find(outcome => outcome.id === `${response.winner}`) : undefined,
winnerOutcome: typeof response.winner === "number"
? outcomes.find(outcome => outcome.id === `${response.winner}`)
: undefined,
totalWallets: response.total_wallets,
poolSize: BigNumber(response.pool_size),
}
Expand Down

0 comments on commit 627d9a4

Please sign in to comment.