Skip to content

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.

Notifications You must be signed in to change notification settings

Tonashiro/oracle-aggregator

Repository files navigation

Oracle Aggregator

Version License

Table of Contents

Introduction

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.

Features

  • 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.

Technologies

  • Framework: Next.js
  • Language: TypeScript
  • Libraries:
    • React
    • Pyth Network Client
    • TailwindCSS
  • Dev Tools:
    • ESLint
    • TypeScript
    • PostCSS
    • Lucide React
    • React Spinners

Prerequisites

Before you begin, ensure you have met the following requirements:

  • Node.js (>= 14.x.x)
  • npm (>= 6.x.x) or yarn (>= 1.x.x)

Installation

To set up your development environment, follow these steps:

  1. Clone the repository:

    git clone https://github.com/Tonashiro/oracle-aggregator.git
    cd oracle-aggregator
  2. Install dependencies:

    npm install
    # or
    yarn install

Development

To start the development server, run:

npm run dev
# or
yarn dev

This will start the Next.js development server. Open your browser and navigate to http://localhost:3000.

Build and Run

To build the project for production, run:

npm run build
# or
yarn build

To start the production server, run:

npm start
# or
yarn start

Custom Price Feeds

To add or remove any price feed, follow these steps:

  1. Navigate to the constants file located in src/constants.

  2. Add the name you want for the new price feed in the symbols array, for example BTC/USD.

  3. 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"
}
  1. To get the Pyth price feeds, visit Pyth Price Feeds.

  2. To get the Switchboard feed hash, visit Switchboard Solana Mainnet, click over the feed you want, and copy the "Feed Hash".

  3. 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.

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published