Skip to main content
This method is available on Chainstack. Not all Hyperliquid methods are available on Chainstack, as the open-source node implementation does not support them yet — see Hyperliquid methods for the full availability breakdown.
The eth_subscribe("logs") JSON-RPC method allows developers to subscribe to real-time updates about new event logs on the Hyperliquid EVM blockchain. The application will receive notifications whenever new logs matching the filter are emitted, making it essential for monitoring smart contract events and building reactive dApps.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  1. subscription type (string, required): Keyword identifying the type of event to subscribe to, logs in this case
  2. filter object (object, optional): The event filter options
    • address — the contract address from which the logs should be fetched. It can be a single address or an array of addresses
    • topics — an array of DATA topics. The event topics for which the logs should be fetched. It can be a single topic or an array of topics

Response

The method returns a subscription ID that can be used to identify and manage the subscription.

Response structure

Initial subscription response:
  • subscription — the subscription ID
Log notification structure:
  • address — the contract address from which the event originated
  • topics — an array of 32-byte data fields containing indexed event parameters
  • data — the non-indexed data that was emitted along with the event
  • blockNumber — the block number in which the event was included
  • transactionHash — the hash of the transaction that triggered the event
  • transactionIndex — the integer index of the transaction within the block’s list of transactions
  • blockHash — the hash of the block in which the event was included
  • logIndex — the integer identifying the index of the event within the block’s list of events
  • removed — boolean value indicating if the event was removed due to a chain reorganization

Usage example

Basic implementation

Note that subscriptions require a WebSocket connection. Install WebSocket cat for testing:
wscat

JavaScript implementation - Monitor ERC-20 transfers

Python implementation - Monitor multiple events

Advanced filtering with topic combinations

Example request

eth_subscribe is a WebSocket-only method, so every example connects over a WebSocket endpoint.
Use your own endpoint in your code. The code examples use a placeholder Chainstack endpoint (YOUR_CHAINSTACK_ENDPOINT) — replace it with your own Hyperliquid node endpoint from the Chainstack console. The curl above uses a shared public endpoint for quick checks only; do not use it in production.

Use cases

The eth_subscribe("logs") method is essential for applications that need to:
  • Monitor token transfers: Track ERC-20/ERC-721 transfers in real-time
  • DEX activity tracking: Monitor swaps, liquidity additions, and removals on decentralized exchanges
  • Smart contract events: React to specific contract events as they occur
  • DeFi protocol monitoring: Track lending, borrowing, and liquidation events
  • Wallet activity alerts: Notify users of incoming/outgoing transactions
  • NFT marketplace activity: Monitor mints, sales, and transfers of NFTs
  • Bridge monitoring: Track cross-chain bridge deposits and withdrawals
  • Governance tracking: Monitor voting and proposal events in DAOs
  • Price oracle updates: Track price feed updates from oracle contracts
  • Security monitoring: Detect suspicious contract interactions in real-time
This WebSocket subscription method provides efficient, real-time event monitoring with lower latency than polling-based approaches, making it ideal for building responsive dApps and monitoring systems.
Last modified on June 24, 2026