Skip to main content

rpcX Demo

About rpcX

rpcX is a new feature on Atlas that enables custom data parsing. Data is returned in JSON format instead of raw bytes, eliminating the need for client code when reading on-chain data.

Example: rpcX Price Feeds

Live at: rpcx.atlas.xyz

This demo is a live example of real-time market data for the SOL/ETH pair powered by Atlas rpcX. In this example, rpcX is used to fetch the already-parsed market data.

Atlas rpcX Demo

rpcX enables developers to isolate backend logic like byte parsing and allows readers of on-chain data to focus on what is important to them. Below, you can see an example of how a frontend could subscribe to price updates by using rpcX.

Breaking down the process:

  1. Oracle prices are stored on-chain as bytes.
  2. Any time the price changes, the updated bytes are sent to the subscriber.
  3. If an rpcX package exists for the price feeds, RPC nodes can parse the updated bytes before sending the update to the subscriber.
  4. As a result, subscribers receive useful JSON , instead of raw bytes that they must figure out how to parse themselves.

Atlas rpcX Demo Code

info

View the live price feeds and inspect the code here.