How galacticcouncil/hydration-node works
Hydration is a Substrate-based cross-chain liquidity protocol. A user connects to a node over RPC and submits transactions; the runtime provides liquidity, routing, asset, oracle, and protocol functions, while node-side workers support ICE solving and liquidation. The tree and README establish these product areas, but sampled runtime implementation is limited, so most pallet-to-pallet relationships are omitted. The node service and synthetic-log relationships are supported by the source index or excerpts; integration tests and build machinery are excluded.
Main entry points: service.rs Chain service · storage_override.rs Synthetic Ethereum logs · main.rs Hydration node · cli.rs CLI and commands
Components 23
Node services
- Hydration node
node/src/main.rs - CLI and commands
node/src/cli.rs - Chain service
node/src/service.rs - RPC endpoints
node/src/rpc.rs - ICE solver worker
node/src/ice_solver_worker.rs - Liquidation worker
node/src/liquidation_worker.rs - Synthetic Ethereum logs
node/src/synthetic_logs/storage_override.rs - Event compatibility
node/src/synthetic_logs/compat_events.rs - Metadata events
node/src/synthetic_logs/metadata_events.rs
Liquidity and routing
- ICE routing and swaps
pallets/ice/src/lib.rs - Route execution
pallets/route-executor/src/lib.rs - Omnipool
pallets/omnipool/src/lib.rs - StableSwap
pallets/stableswap/src/lib.rs - XYK pools
pallets/xyk/src/lib.rs - Recurring swaps
pallets/dca/src/lib.rs
Protocol features
- Asset registry
pallets/asset-registry/src/lib.rs - EMA oracle
pallets/ema-oracle/src/lib.rs - Liquidation pallet
pallets/liquidation/src/lib.rs - Cross-chain messaging
runtime/hydradx/src/xcm.rs
Runtime support
- Hydration runtime
runtime/hydradx/src/lib.rs - Routing interfaces
traits/src/router.rs - Protocol mathematics
math/src/lib.rs
Other components
- Wallet or client
Connections 10
- Wallet or client → Hydration node: connects to
- Hydration node → CLI and commands: runs
node/src/main.rs - CLI and commands → Chain service: starts
node/src/service.rs - Chain service → RPC endpoints: configures
node/src/service.rs - Chain service → ICE solver worker: starts
node/src/service.rs - Chain service → Liquidation worker: starts
node/src/service.rs - Chain service → Synthetic Ethereum logs: configures
node/src/service.rs - Liquidation worker → Liquidation pallet: submits liquidations
node/src/liquidation_worker.rs - Synthetic Ethereum logs → Event compatibility: decodes events
node/src/synthetic_logs/storage_override.rs - Synthetic Ethereum logs → Metadata events: uses metadata
node/src/synthetic_logs/storage_override.rs