Skip to content

Commit

Permalink
fix: build error
Browse files Browse the repository at this point in the history
  • Loading branch information
thechefpenguin committed Jun 12, 2024
1 parent 4a7c71f commit baac962
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions subgraphs/prediction/v3-ai-generic/mappings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,10 @@ export function handleEndRound(event: EndRound): void {
// round.closeRoundId = event.params.roundId; // Not evicted in the new version of event

// Get round result based on lock, close and AI price.
if (round.closePrice) {
if (round.closePrice && round.AIPrice) {
if (
round.closePrice.equals(round.lockPrice as BigDecimal) &&
round.AIPrice?.notEqual(round.lockPrice as BigDecimal)
round.AIPrice.notEqual(round.lockPrice as BigDecimal)
) {
round.position = "House";

Expand All @@ -222,9 +222,9 @@ export function handleEndRound(event: EndRound): void {
market.save();
}
} else if (
(round.closePrice.gt(round.lockPrice as BigDecimal) && round.AIPrice?.gt(round.lockPrice as BigDecimal)) ||
(round.closePrice.lt(round.lockPrice as BigDecimal) && round.AIPrice?.lt(round.lockPrice as BigDecimal)) ||
(round.closePrice.equals(round.lockPrice as BigDecimal) && round.AIPrice?.equals(round.lockPrice as BigDecimal))
(round.closePrice.gt(round.lockPrice as BigDecimal) && round.AIPrice.gt(round.lockPrice as BigDecimal)) ||
(round.closePrice.lt(round.lockPrice as BigDecimal) && round.AIPrice.lt(round.lockPrice as BigDecimal)) ||
(round.closePrice.equals(round.lockPrice as BigDecimal) && round.AIPrice.equals(round.lockPrice as BigDecimal))
) {
// AI win => Follow AI pool wins
round.position = "Bull";
Expand Down

0 comments on commit baac962

Please sign in to comment.