From baac96283c7c9eec8ecab4c336e79d839ab40160 Mon Sep 17 00:00:00 2001 From: Chef Penguin Date: Wed, 12 Jun 2024 17:50:04 +0530 Subject: [PATCH] fix: build error --- subgraphs/prediction/v3-ai-generic/mappings/index.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/subgraphs/prediction/v3-ai-generic/mappings/index.ts b/subgraphs/prediction/v3-ai-generic/mappings/index.ts index 47e0b34f..b2ef04af 100644 --- a/subgraphs/prediction/v3-ai-generic/mappings/index.ts +++ b/subgraphs/prediction/v3-ai-generic/mappings/index.ts @@ -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"; @@ -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";