Site icon Chainstack

How to get an Avalanche RPC endpoint (2026 guide)

avalanche endpoint

TL;DR

Send a request to the wrong Avalanche chain endpoint and you get silent errors that look like network problems — not a clear message telling you that C-Chain, X-Chain, and P-Chain each require a different URL. Avalanche’s three-chain architecture means a single base node URL exposes three separate APIs, and routing the wrong operation to the wrong one is the most common source of integration failures. This guide covers all three chains, when each matters for RPC selection, and how to deploy infrastructure that handles the full Avalanche API surface without the guesswork.

What is an Avalanche RPC endpoint

An Avalanche RPC endpoint is a chain-specific URL — not a single address that handles everything. Each of Avalanche’s three primary chains has its own endpoint path appended to a base node URL, and each speaks a different API dialect:

Every production action routes through one of these:

The operational consequence: if you build a wallet or exchange that handles native AVAX transfers across all three chains, you are not talking to one endpoint — you are managing three separate API surfaces with different authentication, different method namespaces, and different data models.

Beyond the three primary chains, Avalanche supports subnets — customizable, application-specific blockchains that run on Avalanche infrastructure with their own validator sets, virtual machines, and tokenomics. Each subnet exposes its own RPC endpoint, independent from the C/X/P-Chain endpoints. If you are building on or integrating with an Avalanche subnet, you will need a separate managed endpoint for that subnet in addition to your primary chain endpoints. For a deeper look at subnet architecture and development, see the Avalanche subnet series on the Chainstack Blog.

How Avalanche RPC differs from Ethereum RPC

For C-Chain development, Avalanche is intentionally Ethereum-equivalent — the same tooling, the same methods, the same mental model. The differences that matter for RPC selection are below the application layer.

WhatAvalanche C-ChainEthereum
Block time~2 seconds~12 seconds
Finality~1–2 seconds (Snowman consensus)~12 seconds (single slot)
ThroughputHundreds of TPS, peaks above 1,000~15–30 TPS (L1)
Gas tokenAVAXETH
Consensus (C-Chain)Snowman (linear, probabilistic BFT)Proof of Stake
Chain ID43114 (mainnet) / 43113 (Fuji)1 (mainnet)
Multi-chain APIC-Chain + X-Chain + P-Chain (separate endpoints)Single chain, single endpoint
WebSocket on public APIC-Chain onlyFull support

The finality difference is significant for RPC infrastructure design. Snowman consensus finalizes transactions probabilistically in under two seconds — there is no waiting for multiple block confirmations the way Ethereum applications often do. Applications that implement Ethereum-style confirmation polling on Avalanche are adding unnecessary latency and request volume. The right pattern is to treat a single confirmed block as final on C-Chain.

Avalanche RPC endpoint options

Public vs private Avalanche RPC endpoints

The three-chain architecture means provider evaluation is not just about C-Chain performance — it is about whether the provider covers all three chains and whether WebSocket is available beyond C-Chain. The public API handles light workloads well, but drops WebSocket streams under heavy load and does not offer WebSocket for X-Chain.

Official public Avalanche endpoints (Mainnet):

Fuji Testnet:

⚠️ WebSocket limitation: The public API supports WebSocket only on the C-Chain. X-Chain and P-Chain WebSocket connections are not available on the public API node. For applications that subscribe to X-Chain events, managed infrastructure is required.

FeaturePublic API (api.avax.network)Private RPC (Chainstack)
AccessFree, no auth requiredAuthenticated, isolated
ResourcesShared, load-balancedDedicated resources
C-Chain coverageFull JSON-RPCFull JSON-RPC
X-Chain coverageAvailable, throttledAvailable, stable
P-Chain coverageAvailable, throttledAvailable, stable
WebSocketC-Chain onlyC-Chain + X-Chain
Archive accessNot availableC-Chain archive available
Best use caseTesting, light readsAll production workloads

For DeFi protocols and smart contract applications that only touch the C-Chain, the public API is a reasonable starting point. The moment your application needs reliable X-Chain or P-Chain access — or sustained WebSocket subscriptions — managed infrastructure becomes necessary.

📖 For a detailed provider comparison including performance benchmarks and feature analysis, see Best Avalanche RPC providers in 2026.

Full node vs archive Avalanche node

Archive support on Chainstack is available for the C-Chain only. X-Chain and P-Chain archive access is not currently offered. Plan your data architecture around this boundary.

Full node accessArchive node access (C-Chain only)
Current C-Chain contract stateHistorical C-Chain state at any block height
Recent DeFi protocol queriesLong-range eth_getLogs backfills for analytics
X-Chain and P-Chain API callsDeFi protocol TVL history and liquidation audits
Real-time event monitoringBlock explorer-grade data for C-Chain
Transaction broadcastingCompliance and regulatory reporting

Archive access starts at $49/month on Chainstack — confirm whether your use case requires historical C-Chain state queries before choosing a plan. For subnet development and most DeFi applications, full node access is sufficient.

📖 Learn more about Chainstack archive data and what it enables for C-Chain historical queries.

HTTPS vs WebSockets

Avalanche’s sub-two-second finality changes the calculus on WebSocket usage compared to slower chains. Real-time monitoring matters more when blocks come fast — a two-second polling interval on C-Chain already feels sluggish for latency-sensitive applications.

FeatureHTTPSWebSocket
ModelRequest/responsePersistent connection
ComplexitySimple operationallyRequires reconnect/heartbeat logic
Best forC-Chain contract calls, P-Chain/X-Chain queries, batch readsC-Chain real-time tx monitoring, DeFi event streams, MEV bots
LatencyStandardLower for high-frequency C-Chain updates
Connection overheadPer requestOne-time handshake

A critical constraint: WebSocket subscriptions are available on C-Chain only — both on the public API and on Chainstack. If your application needs event streaming from X-Chain transactions, you must poll over HTTPS. Design for this upfront rather than discovering it when you try to subscribe to X-Chain events in production.

How to get a private Avalanche RPC endpoint with Chainstack

  1. Log in to the Chainstack console (or create an account)
  2. Create a new project
  3. Select Avalanche as your blockchain protocol
  4. Choose network: Avalanche Mainnet or Fuji Testnet
  5. Deploy the node
  6. Open Access/Credentials and copy your C-Chain, X-Chain, and P-Chain endpoint URLs
  7. Run a connectivity check on each chain you plan to use before wiring into production

Connect to the C-Chain with ethers.js using your Chainstack endpoint:

const { ethers } = require("ethers");

const provider = new ethers.providers.JsonRpcProvider(
  "YOUR_CHAINSTACK_ENDPOINT/ext/bc/C/rpc",
  43114 // C-Chain Mainnet chain ID — use 43113 for Fuji Testnet
);

// Confirm connectivity: fetch the latest block number
provider.getBlockNumber().then((blockNumber) => {
  console.log("Latest C-Chain block:", blockNumber);
});

📖 For the full integration guide including X-Chain with AvalancheJS, WebSocket setup, Hardhat, Foundry, and Brownie configuration, see the Chainstack Avalanche tooling documentation.

Using Chainlist

Chainlist lists the Avalanche C-Chain (chain ID 43114) and Fuji Testnet (chain ID 43113), and can be used to add them to MetaMask or Rabby in one click. It does not list the X-Chain or P-Chain, as those are not EVM networks. Chainlist is not an infrastructure provider — any public RPC URL added through Chainlist should be replaced with your managed endpoint before going to production.

Chainstack pricing for Avalanche RPC

Chainstack counts requests uniformly across all three Avalanche chains — a C-Chain eth_call, an X-Chain avm.getBalance, and a P-Chain platform.getCurrentValidators all draw from the same monthly request pool at a flat rate per request unit.

PlanCostRequests/MonthRPSOverage (per 1M extra)
Developer$03M (~25 RPS)~25$20
Growth$4920M~250$15
Pro$19980M~400$12.5
Business$499200M~600$10
EnterpriseFrom $990400M+CustomFrom $5

Advanced options:

How to estimate monthly cost

  1. Separate your C-Chain, X-Chain, and P-Chain request volumes — they add up to a single pool but sizing them individually prevents surprises
  2. Factor in WebSocket subscription keepalives — persistent connections generate periodic heartbeat requests
  3. Account for Avalanche’s block speed: at ~2-second blocks, a bot polling every block hits ~1.3M requests/month per polling loop
  4. Add 25–35% buffer for DeFi protocol activity spikes — Avalanche traffic correlates with AVAX price movements and cross-chain bridge volume
  5. If you use archive for historical eth_getLogs backfills, estimate query volume separately — wide-range log queries can be expensive per call

For Avalanche specifically: Applications that also interact with subnets add a separate endpoint and request stream per subnet. If you are building multi-subnet infrastructure, account for each subnet’s traffic independently from the primary chain endpoints.

Production readiness checklist

Before launch, validate these basics:

Avalanche-specific items:

Troubleshooting common Avalanche RPC issues

IssueLikely CauseHow to Fix
X-Chain or P-Chain calls return 404Request sent to C-Chain /ext/bc/C/rpc endpointUse chain-specific paths: /ext/bc/X for X-Chain, /ext/P for P-Chain
WebSocket fails on X-ChainX-Chain WebSocket not available on public APISwitch to HTTPS polling for X-Chain events; use managed provider for WSS
eth_getLogs returns empty on old blocksFull node queried beyond its retained historySwitch to C-Chain archive node for historical log queries
Wrong chain ID in MetaMaskConnected to Fuji (43113) instead of Mainnet (43114)Validate eth_chainId at startup; enforce correct chain ID in wallet connection logic
High latency on validator queriesP-Chain getCurrentValidators is a heavy callCache validator set responses locally; reduce polling frequency to minutes, not seconds
429 Too Many RequestsPublic API rate limit hit during burstMove to managed endpoint; public API drops WebSocket streams and throttles under load

Conclusion

Most Avalanche integration failures are not network issues — they are routing issues. A request to /ext/bc/C/rpc that should have gone to /ext/bc/X returns an error that tells you nothing useful. A WebSocket subscription that works on C-Chain silently fails on X-Chain because the public API never supported it there. These are not edge cases; they are the standard failure modes for teams who treat Avalanche as a single-endpoint EVM chain without reading the architecture first.

The pattern that works: start on C-Chain with the public API, lock down your endpoint routing per chain before writing application logic, and move to managed infrastructure the moment your workload involves X-Chain, sustained WebSocket connections, or historical data queries against the C-Chain archive. That last step is not optional for production — it is the point where the public API’s limitations become your users’ problem.

Start with Chainstack’s free tier (3M requests/month across all three chains), validate your chain-specific endpoint routing and WebSocket behavior in staging, then scale to dedicated infrastructure as DeFi or subnet traffic grows.

FAQ

I only need C-Chain — can I ignore X-Chain and P-Chain entirely?

For pure smart contract development — deploying contracts, reading DeFi state, monitoring events — yes. The C-Chain is fully EVM-compatible and your existing Ethereum tooling works without modification. You only need X-Chain if your application handles native AVAX asset transfers between chains, and P-Chain only if you interact with staking, validators, or subnet management.

Does Avalanche’s fast finality change how I write my confirmation logic?

Yes, meaningfully. Snowman consensus finalizes C-Chain transactions in approximately one to two seconds, so the standard Ethereum pattern of waiting for multiple block confirmations adds unnecessary latency and doubles or triples your polling request volume. For most applications, treating one confirmed Avalanche block as final is the correct and safe approach.

What SDKs work with Avalanche RPC endpoints?

For C-Chain development, any Ethereum-compatible SDK works without modification — ethers.js, web3.js, viem, Hardhat, and Foundry all connect to the C-Chain endpoint using standard Ethereum JSON-RPC. For X-Chain and P-Chain operations, AvalancheJS is the primary SDK, providing typed methods for asset transfers, staking queries, and subnet interactions that are not available in EVM tooling.

Can I use MetaMask with Avalanche?

Yes — MetaMask connects to the C-Chain using the standard EVM network configuration (chain ID 43114, RPC URL pointing to your C-Chain endpoint). MetaMask does not support the X-Chain or P-Chain, as those are not EVM-compatible. For native AVAX cross-chain transfers, Core Wallet is the recommended alternative as it natively supports all three chains.

Is a public Avalanche endpoint sufficient for production?

For low-volume C-Chain applications, the public API is a reasonable starting point. The hard limits arrive when you need reliable WebSocket connections (public streams drop under load), X-Chain WebSocket subscriptions (not available publicly), archive data for historical queries, or consistent throughput for DeFi bots and MEV strategies. Any of these requirements means moving to managed infrastructure.

What should I monitor on my Avalanche RPC layer?

Track latency separately per chain — C-Chain reads, X-Chain queries, and P-Chain validator calls have very different response time profiles. Monitor WebSocket reconnect frequency on C-Chain subscriptions, 429 response rates, and archive query response times if you use historical data. For DeFi applications, also track eth_getLogs query latency — wide block ranges against the archive are the most common source of unexpected slowdowns.

Additional resources

Exit mobile version