← All projects
Developer Tools & Open Source · Apr 2026

DefiLlama SDK: RPC Reliability & Failover

Open-source contribution redesigning RPC endpoint resolution and adding runtime quarantine with cooldown to a production Web3 SDK.

TypeScriptNode.jsWeb3JestOpen Source

A contribution to the DefiLlama SDK, a widely-used TypeScript library for on-chain data access, fixing how the SDK resolves and recovers from RPC endpoints.

RPC resolution and failover

The bug

User-supplied RPC endpoints were being silently overridden by defaults (Fixes #162). If you configured your own node (typically because you were paying for reliability the public endpoints do not provide), the SDK could ignore it. Worse, it failed silently: you would see degraded performance with no signal that your configuration was not being used. I redesigned the chain RPC resolution logic so user-defined endpoints correctly take priority.

Failover

Beyond the fix, dead endpoints were retried indefinitely, so a single bad RPC could degrade every downstream call. I added runtime RPC quarantine: an endpoint that fails 5 times is pulled from rotation for a 10-minute cooldown, then allowed back.

The cooldown is the important detail. Permanently blacklisting a failing endpoint is wrong: most RPC failures are transient, and a provider having a bad minute should not be discarded for the life of the process. Quarantine bounds the blast radius without making the decision irreversible.

Shipped with 8 unit tests covering both override precedence and the failure-handling paths, plus expanded documentation on RPC configuration.