The Problem: N Addresses = N RPC Calls
Querying 10 token balances naively requires 10 separate RPC calls:Basic Usage: Check 10 Balances
Portfolio Balance Aggregation
Query multiple tokens for a single wallet:Error Handling
Handle both batch-level and per-call failures with Effect Schedule:Performance Comparison
| Approach | 10 Addresses | 100 Addresses | 1000 Addresses |
|---|---|---|---|
| Sequential | 10 RPC calls (~2s) | 100 RPC calls (~20s) | 1000 RPC calls (~200s) |
| Parallel | 10 RPC calls (~0.5s) | 100 RPC calls (~5s) | Rate limited |
| Multicall | 1 RPC call (~0.2s) | 1 RPC call (~0.3s) | ~10 RPC calls (~2s) |
When to Use Multicall
Use Multicall when:- Querying the same data across many addresses (balances, allowances)
- Building dashboards or portfolio views
- Reducing RPC costs on paid providers
- Avoiding rate limits
- Making state-changing transactions (use regular calls)
- Querying only 1-2 addresses (overhead not worth it)
- Target chain doesn’t have Multicall3 deployed
Multicall3 Deployment
Multicall3 is deployed at0xcA11bde05977b3631167028862bE2a173976CA11 on:
- Ethereum Mainnet, Goerli, Sepolia
- Polygon, Arbitrum, Optimism, Base
- BSC, Avalanche, Fantom
- Full list
Either Pattern for Result Handling
For more ergonomic result processing, use Effect’sEither type with transformed results:
Either Utilities
| Function | Description |
|---|---|
Either.right(value) | Create a success value |
Either.left(error) | Create an error value |
Either.isRight(result) | Type guard for success |
Either.isLeft(result) | Type guard for failure |
Either.match(result, { onLeft, onRight }) | Exhaustive pattern matching |
Either.map(result, fn) | Transform success value |
Either.mapLeft(result, fn) | Transform error value |
Either.getOrElse(result, defaultFn) | Extract value with fallback |
Separating Results
UseEither.match for exhaustive handling or filter by type:
See Also
- Multicall — Full Multicall API
- Error Handling — Either and typed error patterns
- Provider Service — readContract and simulateContract utilities
- ERC Standards — ERC-20/721/1155 encoding utilities
- Contract Interactions — Single contract reads/writes
- Voltaire Docs — Core Voltaire documentation

