Skip to main content

Optimism Balance Updates API

In this section we will see how to monitor real-time balance changes across the Optimism blockchain.

Important: Rebasing Token Limitations

Rebasing tokens are not supported for accurate balance calculations.

Rebasing tokens (like Mountain Protocol's USDM) automatically adjust their total supply and individual balances through mechanisms other than traditional transfer transactions. This means:

  • Balance calculations may be inaccurate - Our balance tracking doesn't capture rebasing adjustments
  • Balance updates may be missing - Individual holder balances change without visible transactions
  • Historical balance data will be incorrect - Past balances don't reflect rebasing adjustments

Before calculating balances for any token, verify it's not a rebasing token by:

  1. Checking the token's official documentation
  2. Looking for rebasing mechanisms in the smart contract
  3. Consulting token issuer resources

Example of rebasing token: Mountain Protocol USDM (0x59d9356e565ab3a36dd77763fc0d87feaf85508c on Arbitrum) - Documentation

Supported chains: This limitation applies to all EVM chains (Ethereum, Arbitrum, BSC, Base, etc.)

Subscribe to Balance Updates of a Particular Wallet​

The query will subscribe you to real-time updates for balance changes on the Optimism blockchain, providing a continuous stream of data as new transactions are processed and recorded. Here we have used address 0xacD03D601e5bB1B275Bb94076fF46ED9D753435A. You can find the query here

subscription {
EVM(network: optimism) {
BalanceUpdates(
where: {BalanceUpdate: {Address: {is: "0xacD03D601e5bB1B275Bb94076fF46ED9D753435A"}}}
) {
Currency {
Name
}
BalanceUpdate {
Address
Amount
Type
}
Block {
Time
}
Transaction {
Hash
}
}
}
}