Skip to content

akhil888binoy/PriceOracleKeeper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Oracle Price Submitter & Keeper (Rust)

A high-performance price oracle system that fetches real-time token prices from Pyth Network and stores them in a PostgreSQL database using SeaORM. This system combines the functionality of the original Price Submitter and Pricing Keeper.

📦 Architecture Overview

  • Language: Rust
  • Database: PostgreSQL
  • ORM: SeaORM
  • Price Source: Pyth Network
  • Data Granularity: Supports candle generation for 5m, 15m, 1h, 4h, and 1d intervals.
  • Chains Supported:
    • Monad Testnet

⚙️ Features

  • Submits price of tokens to DB every 5 seconds.
  • Built-in support for token candles over multiple timeframes.
  • Uses Pyth price feeds (ideal for tokens not listed on CEX).
  • Easily scalable to support new tokens or chains.
  • Maintains data indexed by timestamp and chain ID for quick retrieval.

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

DATABASE_URL: Postgresql connection URL

ENVJSON : Path of env.json file

🚀 Getting Started

1. Install SeaORM CLI

cargo install sea-orm-cli

2. Create Table in DB

sea migrate up 

3. Install Dependencies

cargo build

4. Run the Monad Oracle Keeper

cargo run 

🛠 Updating Assets or Chains

To add a new asset or chain:

Update asset & chain info in:

  • src/utils/helpers.rs

    • SUPPORTED_TOKENS

    • CHAINID_MAP

    • TOKEN_INFO

📚 DB Schema (PostgreSQL)

Check : entity/src/price_candle.rs

About

A high-performance price oracle system that fetches real-time token prices from Pyth Network and stores them in a PostgreSQL database using SeaORM. This system combines the functionality of the original Price Submitter and Pricing Keeper.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages