Skip to content

Commit 076bfc4

Browse files
committed
add timestamp gate to start processing 1 week prior to runtime
1 parent 0c23820 commit 076bfc4

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/templates/morpho/processor.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ export const createMorphoVaultApyProcessor = (params: { from: number }) => {
2222
throw new Error(`No Morpho config for ${ctx.chain.name} (${ctx.chain.id})`)
2323
}
2424
const snapshots: MorphoVaultApy[] = []
25+
const oneWeekAgo = Date.now() - 7 * 24 * 60 * 60 * 1000
2526

2627
await frequencyUpdate(ctx, async (ctx, block) => {
28+
if (block.header.timestamp < oneWeekAgo) return
2729
let apy: number | null
2830
try {
2931
apy = await fetchVaultApy(ctx, block.header, vaultAddress, morphoAddress)

0 commit comments

Comments
 (0)