About
Technical Architecture
Rails uses a multi-layer architecture to process and serve blockchain data efficiently and accurately. Two data paths run side by side — enriched event history and live chain-truth state — and the API stitches them together.
System Components
1. Blockchain Indexer (Sieve)
Sieve — our in-house indexer — connects directly to Ethereum and monitors all Liquity V2 and Aave V4 contracts in real-time.
- ·Captures Liquity V2 events across three collateral branches (WETH, wstETH, rETH) and Aave V4 spoke activity
- ·Processes Transfer, TroveOperation, TroveUpdated, Liquidation, Redemption, and Batch events, plus Aave V4 Supply, Borrow, Repay, Withdraw, and Liquidation events
- ·Reads from Ethereum through redundant RPC providers — a primary endpoint with automatic failover to a backup
- ·Fetches oracle prices from Chainlink for accurate USD valuations
- ·Routes events to the appropriate processing queues via RabbitMQ
- ·Maintains real-time synchronization with blockchain state
2. Message Queue (RabbitMQ)
Manages event flow and ensures reliable processing of all blockchain events.
- ·Separate queues for different event types
- ·Guarantees event processing even during high load
- ·Enables a decoupled, scalable architecture
3. Processors & Materialized Views
Enrich raw events and pre-compute the heavy joins so reads stay fast.
- ·Attach USD values and protocol-specific context to each event
- ·Write enriched history to Postgres
- ·Materialized views pre-compute positions and timelines so the API serves them cheaply
4. Chain-Truth Refresher
Reads current balances and risk straight from each protocol's contracts, independent of the event history.
- ·A background worker batches reads across positions via Multicall3 on a short refresh
- ·Health factor, collateral factor, and live balances come from chain state, not inferred from events
- ·Keeps positions opened through swap aggregators — which skip a protocol's standard events — accurate on screen
5. API & Frontend
Stitches both data paths together and renders the result.
- ·An Express API joins enriched history with live chain-truth state
- ·The Next.js frontend renders timelines, positions, and event detail
- ·Read-only throughout — no wallet connection, no account, no private keys
Rails is open source. View on GitHub →