Docs

Hydration Liquidity Parachain RPC Guide

Production-ready JSON-RPC guide for Hydration, Polkadot's unified liquidity parachain. Learn verified endpoints, network specs, integration patterns, and troubleshooting tips for HDX builders.

Hydration RPC

With Dwellir, you get access to our global Hydration network which always routes your API requests to the nearest available location, ensuring low latency and the fastest speeds.

Get your API key

Why Build on Hydration?

Hydration powers Polkadot's unified liquidity layer, offering deep cross-chain markets through a single omnipool runtime. Teams choose Hydration because it provides:

Unified Liquidity Router

  • Route any XCM-enabled asset through the omnipool without fragmented pairs
  • Single-sided provisioning with dynamic fee curves tuned for stable markets
  • Built-in MEV protection via adaptive liquidity routing

Native Cross-Chain Execution

  • Parachain-level integrations with fast finality on the Polkadot Relay Chain
  • Out-of-the-box XCM channels to leading parachains for trustless settlement
  • Seamless asset teleportation between Hydration and Kusama's Basilisk network

Developer-First Tooling

  • Full Substrate JSON-RPC coverage with archive snapshots for historical queries
  • Rich analytics via Hydration Subscan and on-chain telemetry feeds
  • Reusable SDK patterns across JavaScript, Rust, and Python ecosystems

Quick Start with Hydration

Connect to Hydration mainnet or Basilisk testnet in seconds using Dwellir-managed infrastructure.

Hydration RPC Endpoints
HTTPS
curl -sS -X POST https://api-hydration.n.dwellir.com/<API_Keys_Are_Not_Made_for_Bots> \  -H 'Content-Type: application/json' \  -d '{"jsonrpc":"2.0","method":"chain_getBlockHash","params":[0],"id":1}'
import { JsonRpcProvider } from 'ethers';const provider = new JsonRpcProvider(  'https://api-hydration.n.dwellir.com/<API_Keys_Are_Not_Made_for_Bots>');const latest = await provider.getBlockNumber();console.log('block', latest);
import requestsurl = 'https://api-hydration.n.dwellir.com/<API_Keys_Are_Not_Made_for_Bots>'payload = {  'jsonrpc': '2.0', 'id': 1,  'method': 'chain_getBlockHash', 'params': [0]}resp = requests.post(url, json=payload)print(resp.json())
package mainimport (  "bytes"  "fmt"  "io"  "net/http")func main() {  url := "https://api-hydration.n.dwellir.com/<API_Keys_Are_Not_Made_for_Bots>"  payload := []byte(`{"jsonrpc":"2.0","id":1,"method":"chain_getBlockHash","params":[0]}`)  resp, err := http.Post(url, "application/json",    bytes.NewBuffer(payload))  if err != nil { panic(err) }  defer resp.Body.Close()  body, _ := io.ReadAll(resp.Body)  fmt.Println(string(body))}

Basilisk Test Environment

Basilisk mirrors Hydration's runtime for staging releases on Kusama. Use the Basilisk endpoints for pre-production load tests and fee estimation before promoting to Hydration mainnet.

Installation & Setup

Network Information

ParameterHydration MainnetBasilisk Testnet
Relay ChainPolkadotKusama
Parachain ID20342090
Genesis Hash0xafdc188f45c71dacbaa0b62e16a91f726c7b8699a9748cdf715459de6b7f366d0xa85cfb9b9fd4d622a5b28289a02347af987d8f73fa3108450e2b4a11c1ce5755
Runtime (2025-10-01)specVersion 347, transactionVersion 1specVersion 127, transactionVersion 1
Unit SymbolHDXBSX
Decimals1212
SS58 Prefix6310041
Explorerhydration.subscan.iobasilisk.subscan.io

Additional Details

ParameterValueDetails
Average Block Time6 secondsGRANDPA finality
Native Liquidity PoolsOmnipool, LRNA staking, and routing pallets

API Reference

Hydration exposes the full Substrate RPC surface for core operations, staking, governance, liquidity, and runtime-specific state_call helpers for omnipool pricing and router analytics.

Common Integration Patterns

Real-Time Block Streaming

TypeScript
import { ApiPromise, WsProvider } from '@polkadot/api';

const provider = new WsProvider('wss://api-hydration.n.dwellir.com/YOUR_API_KEY');
const api = await ApiPromise.create({ provider });

api.rpc.chain.subscribeNewHeads((header) => {
  console.log(`New Hydration block #${header.number.toString()} (${header.hash.toHex()})`);
});

Query Treasury Balances via Raw Storage

Bash
curl https://api-hydration.n.dwellir.com/YOUR_API_KEY \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 42,
    "method": "state_getStorage",
    "params": [
      "0x26aa394eea5630e07c48ae0c9558cef7b6a7c9a35a95a160cb4cad330558dfa56d6f646c755b98a7afd0913860592153322b957be394a0619f20b32679ac1014"
    ]
  }'

The key above targets System.Account for 5EYCAe5jiUusQ3yAkVAP1YF81oXasuAHt2KG8Xjc433Zbx8A (Hydration treasury). Decode the SCALE response to obtain the 6,952,142,503,371.701702601733 HDX free balance observed on 2025-10-01.

Batch Weight and Fee Simulation

TypeScript
const api = await ApiPromise.create({ provider: new WsProvider('wss://api-hydration.n.dwellir.com/YOUR_API_KEY') });

const tx = api.tx.omnipool.sell(
  assetInId,
  assetOutId,
  amountIn,
  minimumReceived
);

const info = await api.rpc.payment.queryInfo(tx.toHex());
console.log(`Estimated fee: ${info.partialFee.toHuman()}`);
console.log(`Weight: ${info.weight.toString()} refTime`);

Performance Best Practices

  • Prefer WebSocket endpoints for subscriptions (chain_subscribeNewHeads, grandpa_subscribeJustifications).
  • Cache runtime metadata and type registries keyed by specVersion (347 as of 2025-10-01) to avoid repeated handshakes.
  • Use state_getKeysPaged with pageSize <= 1000 when scanning omnipool storage to prevent heavy RPC loads.
  • Rate-limit bulk extrinsic submissions and enable exponential backoff on author_submitExtrinsic errors.
  • Pin queries to finalized block hashes whenever you need deterministic historical data.

Troubleshooting

SymptomLikely CauseResolution
API key does not existMissing or mis-typed Dwellir keyRe-issue credentials via the Dwellir dashboard and update endpoint URLs
1010: Invalid TransactionRuntime version drift or outdated nonceRe-fetch metadata, synchronize account nonce, and rebuild the payload
Null state_getStorage responseStorage key mismatchRecompute the key with blake2_128_concat of the SS58-decoded AccountId
WebSocket disconnects after idleInactive ping/pongEnable keep-alive heartbeats every 20 seconds and auto-retry with jitter

FAQs

Does Hydration support archive queries? Yes. Dwellir retains full historical state so you can request old block hashes, query omnipool states, and reconstruct trades for compliance.

What SS58 prefix should wallets use? Hydration uses prefix 63. Basilisk uses 10041. Ensure address derivation matches the target environment.

How do I estimate swap slippage programmatically? Fetch omnipool reserves via state_call (custom RPC OmnipoolApi_quotePrice) and pair it with payment_queryInfo estimates to account for weight-based fees.

Smoke Tests

Run these checks before deploying to production:

  1. Node health

    Bash
    curl https://api-hydration.n.dwellir.com/YOUR_API_KEY \
      -H "Content-Type: application/json" \
      -d '{"jsonrpc":"2.0","id":1,"method":"system_health","params":[]}'

    Expect peers ≥ 8 and isSyncing: false.

  2. Latest header

    Bash
    curl https://api-hydration.n.dwellir.com/YOUR_API_KEY \
      -H "Content-Type: application/json" \
      -d '{"jsonrpc":"2.0","id":2,"method":"chain_getHeader","params":[]}'

    Confirm block numbers advance roughly every 6 seconds.

  3. Account snapshot

    Bash
    curl https://api-hydration.n.dwellir.com/YOUR_API_KEY \
      -H "Content-Type: application/json" \
      -d '{"jsonrpc":"2.0","id":3,"method":"state_getStorage","params":["0x26aa394eea5630e07c48ae0c9558cef7b6a7c9a35a95a160cb4cad330558dfa56d6f646c755b98a7afd0913860592153322b957be394a0619f20b32679ac1014"]}'

    Decode the SCALE payload and verify balances.

Migration Guide (Polkadot → Hydration)

  • Update endpoints: Replace legacy Polkadot URLs with https://api-hydration.n.dwellir.com/YOUR_API_KEY or the Basilisk staging endpoint.
  • Adjust address encoding: Switch wallet and service configurations to SS58 prefix 63. Existing Polkadot addresses (prefix 0) must be re-derived.
  • Refresh metadata: Download the latest metadata (specVersion 347) and update custom type bundles for omnipool-related pallets.
  • Re-evaluate fees: Run payment_queryInfo against Hydration extrinsics. Weights differ from Polkadot because of liquidity logic.
  • Review pallet availability: Hydration includes omnipool, router, and incentive pallets not present on Polkadot; ensure you check rpc_methods for the namespaces you rely on.

Resources & Tools

Ready to launch? Deploy with Hydration's omnipool liquidity and monitor production traffic through Dwellir's analytics.