Skip to content

Commit

Permalink
assign season to pool
Browse files Browse the repository at this point in the history
  • Loading branch information
soilking committed Oct 15, 2024
1 parent 6cedba1 commit a9dc4a5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions projects/subgraph-bean/src/utils/Pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit a9dc4a5

Please sign in to comment.