From a9dc4a5a253eac54faa9d6ab21aac34de41be8c5 Mon Sep 17 00:00:00 2001 From: Soil King <157099073+soilking@users.noreply.github.com> Date: Tue, 15 Oct 2024 14:26:06 -0700 Subject: [PATCH] assign season to pool --- projects/subgraph-bean/src/utils/Pool.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/projects/subgraph-bean/src/utils/Pool.ts b/projects/subgraph-bean/src/utils/Pool.ts index 3e18489c9..6d01ef36f 100644 --- a/projects/subgraph-bean/src/utils/Pool.ts +++ b/projects/subgraph-bean/src/utils/Pool.ts @@ -5,6 +5,7 @@ import { checkPoolCross } from "./Cross"; import { DeltaBAndPrice } from "./price/Types"; import { loadOrCreatePool, loadOrCreatePoolDailySnapshot, loadOrCreatePoolHourlySnapshot } from "../entities/Pool"; import { toAddress } from "../../../subgraph-core/utils/Bytes"; +import { loadOrCreateSeason } from "../entities/Season"; export function updatePoolValues( poolAddress: Address, @@ -75,9 +76,9 @@ export function updatePoolSeason(poolAddress: Address, season: i32, block: ether let poolHourly = loadOrCreatePoolHourlySnapshot(poolAddress, block); let poolDaily = loadOrCreatePoolDailySnapshot(poolAddress, block); - pool.lastSeason = season; - poolHourly.season = season; - poolDaily.season = season; + pool.lastSeason = loadOrCreateSeason(season).id; + poolHourly.season = pool.lastSeason; + poolDaily.season = pool.lastSeason; pool.save(); poolHourly.save();