~90 chains on public RPCs

How Nordstern serves swaps on 100+ EVM chains with eRPC and public RPCs

Nordstern is the swap API that quietly wins over half of the swaps in the meta-aggregators that integrate it. It finds the best route for a trade across DEXes and market makers on 100+ EVM chains. With eRPC in front of public RPC endpoints, Nordstern runs about 90 of those chains with no premium RPC provider, and can go live on a new chain within a few hours of its launch.

EVM chains supported
100+
chains served by eRPC over public RPCs
~90
premium RPC contracts needed to launch on a new chain
0

Meet Nordstern

Nordstern was founded by Simon Klein, who came from algorithmic trading: he automated trading systems on the largest commodity trading floor in Europe. He moved to DeFi because he saw how inefficient on-chain execution was.

Nordstern has no swap UI of its own and no retail users. It works with the projects where users already swap: wallets, meta-aggregators and cross-chain apps such as LI.FI, deBridge, Mayan and Matcha Meta (all integrations). In the meta-aggregators that integrate it, Nordstern usually wins over 50% of all swaps. Nordstern charges no swap or subscription fees, so it grows by winning as much volume as it can. Its partners' users are on every EVM chain, so Nordstern must be on every EVM chain too.

Premium RPC and public RPC

Every swap starts with RPC calls: Nordstern reads prices, pool state and gas from the chain through an RPC endpoint. There are two kinds:

  • Premium RPC: a paid provider runs its own nodes for a chain and sells access under a contract, with rate limits, an uptime guarantee and support. Each chain needs the provider to support it, and each provider needs its own contract.
  • Public RPC: free endpoints that chains and node operators publish for anyone to use. No contract, no guarantee, and quality changes from endpoint to endpoint.

Challenges

  • A long tail of chains with no premium RPC: Nordstern supports 100+ EVM chains. On most of the smaller chains, no premium RPC provider exists. Where one does exist, a contract with a new provider for each chain does not make sense.
  • Public RPCs are unreliable: Public endpoints are very unreliable. Some always answered eth_blockNumber and eth_getBlockByNumber, so health checks showed them as live, but they did not answer other methods correctly. For some requests, we got errors back again and again.
  • Bad values from some nodes: On some chains, nodes answered eth_gasPrice and eth_maxPriorityFeePerGas with hard-coded values instead of real ones.
  • New chains launch all the time: We want to support a new chain as soon as it launches. With premium RPC only, we would first have to sign with a provider for each new chain.
  • Request volume makes premium RPC expensive: Our system is scaling to 5,000 requests per second, continuous. At that volume, premium RPC on every chain is not affordable, and it is very important for us not to amplify requests to paid providers.

Setup

Two tiers of RPC

We split our chains by what matters most on each:

  • Top 10 chains: latency matters most. These chains use a premium RPC provider. The provider runs close to our servers, at about 10–15 ms per call.
  • About 90 smaller chains: reliability matters more than latency. These chains run through eRPC, which routes across the public RPC endpoints of each chain.

Deployment

eRPC runs in our Kubernetes cluster (image ghcr.io/erpc/erpc), and we keep it on the latest release. The config lives in Git and is deployed with Argo CD (GitOps).

Per-method upstream selection

eRPC scores each upstream for each method, not only for the chain as a whole. An endpoint that answers eth_blockNumber but fails other methods stops getting those methods. Since we turned this on, we no longer get the recurring errors from endpoints that looked healthy but were not.

Hedging and failover

Hedged requests and failover across the public endpoints of each chain make very unreliable upstreams much more reliable for us.

Consensus for gas price

For eth_gasPrice and eth_maxPriorityFeePerGas, eRPC asks more than one upstream and accepts the answer they agree on. This filters out the nodes that return hard-coded values. Consensus runs on more than 50 of our chains.

Fast support for new chains

To add a new chain, we add its public RPC endpoints to the eRPC config. No provider has to add the chain first, and no contract is needed. A new chain is live within a few hours.

Results

  • About 90 chains with no premium RPC: eRPC lets public endpoints carry the long tail, so premium RPC is spent only on the 10 chains where latency matters.
  • New chains within a few hours: We go live on a new chain within a few hours of it having public RPCs, without first signing with any RPC provider.
  • Fewer method errors: Per-method scoring ended the recurring errors from endpoints that answered some methods but not others.
  • Correct gas prices: Consensus on gas price methods filters out hard-coded node values.
“Failover sounds like a small feature, but there is so much to it. eRPC makes very unreliable public RPCs so much more reliable for us. That's a key feature for us.”
Simon KleinCEO, Nordstern
“When a new chain launches, we can launch with it within hours: tap into its public RPCs and go live without first having to align with any RPC provider.”
Simon KleinCEO, Nordstern