File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
ingest/sqs/pools/ingester Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -402,7 +402,11 @@ func (pi *poolIngester) convertPool(
402402 }
403403
404404 // Set base preecision to USDC
405- basePrecison = tokenPrecisionMap [usdcDenom ]
405+ basePrecison , ok = tokenPrecisionMap [usdcDenom ]
406+ if ! ok {
407+ errorInTVLStr = "no precision for denom " + usdcDenom
408+ continue
409+ }
406410 } else {
407411 // If there is no method to compute TVL for this denom, attach error and silently skip it.
408412 errorInTVLStr = err .Error ()
@@ -416,6 +420,11 @@ func (pi *poolIngester) convertPool(
416420
417421 uosmoBaseAssetSpotPrice = uosmoBaseAssetSpotPrice .Mul (precisionMultiplier )
418422
423+ if uosmoBaseAssetSpotPrice .IsZero () {
424+ errorInTVLStr = "failed to calculate spot price due to it becoming zero from truncations " + balance .Denom
425+ continue
426+ }
427+
419428 routingInfo = denomRoutingInfo {
420429 PoolID : poolForDenomPair ,
421430 Price : uosmoBaseAssetSpotPrice ,
You can’t perform that action at this time.
0 commit comments