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:
- URL query parameter: Append
apiKey=YOUR_API_KEY to the connection string.
- Header: Include
x-api-key: YOUR_API_KEY in your request headers.
Parameters
| Parameter | Required | Description |
|---|
chainId | Yes | The blockchain network ID. Currently, only mainnet is supported. |
apiKey / x-api-key | Yes | Your 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.
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
| Name | chainId | Status |
|---|
| Ethereum Mainnet | mainnet | Supported |
| Testnets | testnet | Coming 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.