@@ -104,17 +104,6 @@ ponder.on("UniswapV4Initializer:Create", async ({ event, context }) => {
104104 ethPrice,
105105 context,
106106 } ) ,
107- insertOrUpdateDailyVolume ( {
108- poolAddress : poolAddress ,
109- amountIn : 0n ,
110- amountOut : 0n ,
111- timestamp,
112- context,
113- tokenIn : assetAddress ,
114- tokenOut : numeraireAddress ,
115- ethPrice,
116- marketCapUsd,
117- } ) ,
118107 addCheckpoint ( {
119108 poolAddress : poolAddress ,
120109 asset : assetAddress ,
@@ -127,6 +116,18 @@ ponder.on("UniswapV4Initializer:Create", async ({ event, context }) => {
127116 context,
128117 } ) ,
129118 ] ) ;
119+
120+ await insertOrUpdateDailyVolume ( {
121+ poolAddress : poolAddress ,
122+ amountIn : 0n ,
123+ amountOut : 0n ,
124+ timestamp,
125+ context,
126+ tokenIn : assetAddress ,
127+ tokenOut : numeraireAddress ,
128+ ethPrice,
129+ marketCapUsd,
130+ } ) ;
130131} ) ;
131132
132133ponder . on ( "UniswapV4Pool:Swap" , async ( { event, context } ) => {
@@ -246,18 +247,19 @@ ponder.on("UniswapV4Pool:Swap", async ({ event, context }) => {
246247 ethPrice,
247248 context,
248249 } ) ,
249- insertOrUpdateDailyVolume ( {
250- poolAddress : address ,
251- amountIn,
252- amountOut,
253- timestamp,
254- context,
255- tokenIn,
256- tokenOut,
257- ethPrice,
258- marketCapUsd,
259- } ) ,
260250 ] ) ;
251+
252+ await insertOrUpdateDailyVolume ( {
253+ poolAddress : address ,
254+ amountIn,
255+ amountOut,
256+ timestamp,
257+ context,
258+ tokenIn,
259+ tokenOut,
260+ ethPrice,
261+ marketCapUsd,
262+ } ) ;
261263} ) ;
262264
263265ponder . on ( "UniswapV4Initializer2:Create" , async ( { event, context } ) => {
@@ -340,17 +342,6 @@ ponder.on("UniswapV4Initializer2:Create", async ({ event, context }) => {
340342 ethPrice,
341343 context,
342344 } ) ,
343- insertOrUpdateDailyVolume ( {
344- poolAddress : poolAddress ,
345- amountIn : 0n ,
346- amountOut : 0n ,
347- timestamp,
348- context,
349- tokenIn : assetAddress ,
350- tokenOut : numeraireAddress ,
351- ethPrice,
352- marketCapUsd,
353- } ) ,
354345 addCheckpoint ( {
355346 poolAddress : poolAddress ,
356347 asset : assetAddress ,
@@ -363,6 +354,17 @@ ponder.on("UniswapV4Initializer2:Create", async ({ event, context }) => {
363354 context,
364355 } ) ,
365356 ] ) ;
357+ await insertOrUpdateDailyVolume ( {
358+ poolAddress : poolAddress ,
359+ amountIn : 0n ,
360+ amountOut : 0n ,
361+ timestamp,
362+ context,
363+ tokenIn : assetAddress ,
364+ tokenOut : numeraireAddress ,
365+ ethPrice,
366+ marketCapUsd,
367+ } ) ;
366368} ) ;
367369
368370ponder . on ( "UniswapV4Pool2:Swap" , async ( { event, context } ) => {
@@ -482,16 +484,17 @@ ponder.on("UniswapV4Pool2:Swap", async ({ event, context }) => {
482484 ethPrice,
483485 context,
484486 } ) ,
485- insertOrUpdateDailyVolume ( {
486- poolAddress : address ,
487- amountIn,
488- amountOut,
489- timestamp,
490- context,
491- tokenIn,
492- tokenOut,
493- ethPrice,
494- marketCapUsd,
495- } ) ,
496487 ] ) ;
488+
489+ await insertOrUpdateDailyVolume ( {
490+ poolAddress : address ,
491+ amountIn,
492+ amountOut,
493+ timestamp,
494+ context,
495+ tokenIn,
496+ tokenOut,
497+ ethPrice,
498+ marketCapUsd,
499+ } ) ;
497500} ) ;
0 commit comments