eth_getLogs - Unichain RPC Method
Query event logs on Unichain. Essential for indexing decentralized exchanges, liquidity protocols, and MEV-protected DeFi applications on Uniswap's DeFi-optimized Superchain L2 with 250ms sub-blocks and 95% lower costs than Ethereum.
Returns an array of all logs matching a given filter object on Unichain.
Why Unichain? Build on Uniswap's DeFi-optimized Superchain L2 with 250ms sub-blocks and 95% lower costs than Ethereum with 250ms sub-blocks (fastest L2), TEE-secured block building, native Superchain interoperability, and 65% revenue to validators.
Use Cases
The eth_getLogs method is essential for:
- Event indexing - Track contract events for decentralized exchanges, liquidity protocols, and MEV-protected DeFi applications
- Token transfers - Monitor ERC20/ERC721 transfers
- DeFi analytics - Track swaps, liquidity events, and more
- Notification systems - Alert on specific on-chain events
Code Examples
Error Handling
| Error Code | Message | Description |
|---|---|---|
| -32005 | Query returned more than 10000 results | Reduce block range |
| -32602 | Invalid params | Invalid filter parameters |
Related Methods
eth_newFilter- Create a filter for logseth_getFilterChanges- Poll filter for new logs
eth_call
Execute smart contract calls without creating transactions on Unichain. Essential for reading contract state for decentralized exchanges, liquidity protocols, and MEV-protected DeFi applications.
eth_newFilter
Create an event log filter on Unichain. Essential for event monitoring, contract activity tracking, and DeFi event streaming for decentralized exchanges, liquidity protocols, and MEV-protected DeFi applications.