Processed (unconfirmed) events and bars faster than wss://graph.codex.io/graphql. Each one runs close to where its networks produce blocks, so trades reach you sooner wherever your app is hosted.
Edge nodes are in beta. They use the same API key, the same
graphql-transport-ws protocol, and the same billing as the main endpoint. WebSockets require a Growth or Enterprise plan. Learn more.Which edge node to use
Pick the edge node by network, not by where your servers are. For example, use the Solana edge node for Solana data even if your app runs in the US or Asia.
If you send a subscription for a network to the wrong edge node, it still works, but it is relayed from the main API and gets no speed benefit.
What the edge nodes serve
The speed benefit applies to these four subscriptions whencommitmentLevel includes Processed, for a single supported network:
onEventsCreatedonTokenEventsCreatedonBarsUpdated(setquoteToken)onTokenBarsUpdated
- Other subscriptions (prices, holders, stats, balances, launchpad events, and so on) are accepted, but they are relayed from the main API. That adds a hop, so they arrive slightly later than on
graph.codex.io. Keep them on the main endpoint. Confirmeddata always comes from the main API. If you subscribe to[Processed, Confirmed]on an edge node, you get the Processed update from the edge node and the Confirmed update from the main API, at most once per stage. Leaving outcommitmentLevelmeansConfirmed, the same as on the main endpoint.- Queries and mutations are not accepted. Send them to
https://graph.codex.io/graphql. Preprocessedis not supported. It is deprecated becauseProcessedon an edge node now gives the earliest data. UseProcessedinstead.
graph.codex.io connection for confirmed data and everything else.
Connecting
SDK
In@codex-data/sdk 2.4.1 or later, pass { useEdge: true } as the options argument to use the Solana edge node.
useEdge is experimental. It only accepts the four subscriptions above, with Processed in commitmentLevel, on Solana. Base is not supported in the SDK yet, so connect to the Base edge node directly as shown below.
Direct WebSocket
Connect the same way you connect to the main endpoint (see Subscriptions), with the edge node endpoint:graphql-ws
Good to know
- Processed data is unconfirmed. A small number of events can be dropped or reorged out before confirmation. Use
Confirmedfrom the main API when you need settled data. - Billing is the same. Each delivered message costs the same as it would on
graph.codex.ioand counts against the same plan. Edge connections count toward your account’s connection limit. - Regional feed errors. If an edge node loses its feed for a network, the affected subscriptions end with an
EDGE_NETWORK_UNAVAILABLEerror. Other subscriptions on the connection keep running. Resubscribe, or fall back tograph.codex.iountil it recovers. - Token bars. On edge nodes,
onTokenBarsUpdatedreturns the same data forFILTEREDandUNFILTEREDstatsType, and theliquidityvalue refreshes at most every 30 seconds. - More networks. More networks and edge nodes will be added over time. Check the changelog for updates.