Skip to content

Fix: per-token error handling in EVM balance queries#3666

Open
TaprootFreak wants to merge 1 commit intodevelopfrom
fix/evm-token-balance-resilience
Open

Fix: per-token error handling in EVM balance queries#3666
TaprootFreak wants to merge 1 commit intodevelopfrom
fix/evm-token-balance-resilience

Conversation

@TaprootFreak
Copy link
Copy Markdown
Collaborator

Summary

  • A single failing token in getTokenBalances() (e.g. broken decimals() call) could abort the entire loop, preventing balance updates for all tokens on that chain
  • Added per-token try/catch in evm-client.ts and citrea-base-client.ts so other tokens continue processing when one fails

Context

Investigation of BBTC (Asset 394) plus balance showing 0.001 instead of 1.73 BBTC (on-chain). The liquidity_balance hasn't been updated since 2026-04-30 despite the cron running every minute. Production logs show no Ethereum-specific errors, pointing to either an Alchemy indexing lag or a silent token processing failure that goes unlogged due to missing error handling in the loop.

Test plan

  • Verify build passes
  • Monitor BBTC balance updates after deploy
  • Check logs for any newly surfaced per-token errors

A single failing token (e.g. broken decimals() call) in getTokenBalances
could abort the entire loop, preventing balance updates for all tokens
on that chain. Wrap each token iteration in try/catch so other tokens
continue processing when one fails.
@TaprootFreak TaprootFreak marked this pull request as ready for review May 2, 2026 18:30
@TaprootFreak TaprootFreak requested a review from davidleomay as a code owner May 2, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant