Skip to content

Commit 2381e7c

Browse files
authored
get always fresh pool
1 parent 839fc6d commit 2381e7c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/subgraph/src/mappingHelpers.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,13 @@ export function getOrInitSubscription(
463463
}
464464

465465
export function getOrInitPool(event: ethereum.Event, poolId: string): Pool {
466-
// get existing pool
467-
let pool = Pool.load(poolId);
466+
// get existing pool from block including in memory updates
467+
let pool = Pool.loadInBlock(poolId);
468+
469+
if (pool == null) {
470+
// get existing pool from store
471+
pool = Pool.load(poolId);
472+
}
468473

469474
// init new pool if non-existent
470475
if (pool == null) {

0 commit comments

Comments
 (0)