{"id":27971,"library":"multicall","title":"Multicall","description":"Aggregate results from multiple Ethereum contract calls into a single RPC call, using the MakerDAO Multicall contract. Current version 0.15.2, compatible with Python >=3.10 and <4. Release cadence is irregular.","status":"active","version":"0.15.2","language":"python","source_language":"en","source_url":"https://github.com/banteg/multicall.py","tags":["ethereum","multicall","web3","aggregation"],"install":[{"cmd":"pip install multicall","lang":"bash","label":"Default install"}],"dependencies":[{"reason":"Required for Ethereum interaction","package":"web3","optional":false},{"reason":"Used for async HTTP requests","package":"httpx","optional":false}],"imports":[{"note":"No common wrong import; always use this.","wrong":"from multicall import Multicall","symbol":"Multicall","correct":"from multicall import Multicall"},{"note":"Call is a separate class; do not import from Multicall.","wrong":"from multicall import Multicall","symbol":"Call","correct":"from multicall import Call"}],"quickstart":{"code":"from multicall import Multicall, Call\nfrom web3 import Web3\n\nw3 = Web3(Web3.HTTPProvider('https://mainnet.infura.io/v3/YOUR-PROJECT-ID'))\nmulti = Multicall([\n    Call(('0x...', 'balanceOf(address)(uint256)'), [['0x...', None]]),\n], _w3=w3)\nresult = multi()\nprint(result)","lang":"python","description":"Create a Multicall instance with a list of Call objects, then call it to aggregate results."},"warnings":[{"fix":"Replace `.aggregate()` with a direct call: `multi()` instead of `multi.aggregate()`.","message":"In version 0.10.0, the API changed from using `Multicall.aggregate()` to calling the instance directly `multi()`. Old code using `.aggregate()` will break.","severity":"breaking","affected_versions":"<0.10.0"},{"fix":"Use `Multicall(..., web3=w3)` instead of `Multicall(..., _w3=w3)`.","message":"The `_w3` argument is deprecated in favor of passing a `web3` instance directly to the `Multicall` constructor.","severity":"deprecated","affected_versions":">=0.12.0"},{"fix":"Use `Web3.to_checksum_address()` on all addresses before passing to `Call`.","message":"Call targets must be checksummed addresses; passing an address without correct checksum will raise an error.","severity":"gotcha","affected_versions":">0.8.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Verify the contract address and RPC URL. Ensure the block is within the chain's range.","cause":"The target contract or block does not exist, or the RPC endpoint is faulty.","error":"EthCallError: No data returned from call at block"},{"fix":"Call the instance directly: `multi()` instead of `multi.aggregate()`.","cause":"Using the old API on multicall >=0.10.0 which removed `.aggregate()`.","error":"AttributeError: 'Multicall' object has no attribute 'aggregate'"},{"fix":"Use `Web3.to_checksum_address('0x...')` on the address.","cause":"Passing an address without proper EIP-55 checksumming.","error":"ValueError: Address must be checksummed"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}