Skip to content

Commit

Permalink
runtime: store extracted swap pairs
Browse files Browse the repository at this point in the history
  • Loading branch information
pro-wh committed May 15, 2024
1 parent 5a6982e commit 9c6302a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions analyzer/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,4 +472,27 @@ func (m *processor) queueDbUpdates(batch *storage.QueryBatch, data *BlockData) {
)
}
}

// Insert swap pairs.
for pairAddress, pair := range data.SwapPairs {
batch.Queue(
queries.RuntimeEVMSwapPairUpsertCreated,
m.runtime,
pairAddress,
pair.Factory,
pair.Token0,
pair.Token1,
data.Header.Round,
)
}
for pairAddress, sync := range data.SwapSyncs {
batch.Queue(
queries.RuntimeEVMSwapPairUpsertSync,
m.runtime,
pairAddress,
sync.Reserve0,
sync.Reserve1,
data.Header.Round,
)
}
}

0 comments on commit 9c6302a

Please sign in to comment.