Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.uniblock.dev/llms.txt

Use this file to discover all available pages before exploring further.

Hydromancer WebSockets provide high-performance, real-time data streaming for decentralized exchanges and DeFi protocols. By integrating Hydromancer through Uniblock, you can access low-latency market data and transaction events via a unified interface.

Endpoint

To connect to Hydromancer WebSockets through Uniblock, use the following base URL:
wss://websocket.uniblock.dev/hydromancer

Authentication

Uniblock supports two ways to authenticate your Hydromancer WebSocket connection and validation requests:
  1. URL query parameter: Append apiKey=YOUR_API_KEY to the connection string.
  2. Header: Include x-api-key: YOUR_API_KEY in your request headers.

Parameters

ParameterRequiredDescription
chainIdYesThe blockchain network ID. Currently, only mainnet is supported.
apiKey / x-api-keyYesYour unique Uniblock API key.

Validate connection

Before integrating, use the validation endpoint to verify your credentials. You can pass the API key in the URL or the header.

Option 1: Header authentication

Header authentication is recommended to avoid exposing your API key in URLs.
curl --location 'https://websocket.uniblock.dev/hydromancer/validate?chainId=mainnet' \
  --header 'x-api-key: YOUR_API_KEY'

Option 2: URL authentication

curl --location 'https://websocket.uniblock.dev/hydromancer/validate?chainId=mainnet&apiKey=YOUR_API_KEY'

Supported networks

NamechainIdStatus
Ethereum MainnetmainnetSupported
TestnetstestnetComing Soon

Features and subscriptions

Hydromancer supports provider-specific subscription messages after connection. Once connected, you can send subscription messages as defined in the Hydromancer protocol documentation.

Common channels

  • L2 Book: Real-time order book snapshots and updates.
  • Trades: Individual trade executions across supported DEXs.
  • Mids: Real-time mid-price updates.

Best practices

  • Security: Use the x-api-key header where possible to avoid exposing your key in server logs or browser history.
  • Keep-alive: Implement a heartbeat with ping/pong every 30 to 60 seconds to prevent connection timeouts.
  • Reconnection: Use an exponential backoff strategy for reconnections to handle network instability.