- Introduction
- Features
- Technologies
- Prerequisites
- Installation
- Development
- Build and Run
- Custom Price Feeds
Oracle Aggregator is a powerful tool designed to fetch and aggregate price data from Pyth and Switchboard oracles. By averaging the price feeds from these sources, this project aims to provide a more accurate and reliable price.
- Data Aggregation: Collects price feeds from Pyth and Switchboard.
- Accurate Pricing: Averages the prices to provide a more precise and dependable value.
- Modern Stack: Built with Next.js, React, and TypeScript.
- Framework: Next.js
- Language: TypeScript
- Libraries:
- React
- Pyth Network Client
- TailwindCSS
- Dev Tools:
- ESLint
- TypeScript
- PostCSS
- Lucide React
- React Spinners
Before you begin, ensure you have met the following requirements:
- Node.js (>= 14.x.x)
- npm (>= 6.x.x) or yarn (>= 1.x.x)
To set up your development environment, follow these steps:
-
Clone the repository:
git clone https://github.com/Tonashiro/oracle-aggregator.git cd oracle-aggregator -
Install dependencies:
npm install # or yarn install
To start the development server, run:
npm run dev
# or
yarn devThis will start the Next.js development server. Open your browser and navigate to http://localhost:3000.
To build the project for production, run:
npm run build
# or
yarn buildTo start the production server, run:
npm start
# or
yarn startTo add or remove any price feed, follow these steps:
-
Navigate to the
constantsfile located insrc/constants. -
Add the name you want for the new price feed in the
symbolsarray, for exampleBTC/USD. -
Add the new value inside the priceIds object. Follow the structure of the existing entries as a guide. For example:
"BTC/USD": {
pyth: "your_pyth_price_feed",
switchboard: "your_switchboard_feed_hash",
icon: "/path/to/your/icon.svg"
}
-
To get the Pyth price feeds, visit Pyth Price Feeds.
-
To get the Switchboard feed hash, visit Switchboard Solana Mainnet, click over the feed you want, and copy the "Feed Hash".
-
Finally, add a new icon in the project or use one from the web. Just paste the URL or path to the icon in the icon field.
That's it! You have now added a new price feed to track using both oracle aggregators.