Jellyverse Docs
WebsiteApp
English
English
  • Overview
    • How to Connect to SEI
    • How to get SEI Devnet Funds
    • How to make your first Swap
  • Protocol Library
    • JellySwap
      • Liquidity Management
        • Swaps
      • Pools
        • Weighted Pools
        • Stable Pools
          • Composable Stable Pools
        • Setting up a Pool Configuration
      • Impermanent Loss
        • 50/50 Pools
        • 80/20 Pools
        • Multitoken Pools
      • Preminted JPT
      • Relayers
      • Smart Order Router (SOR)
    • JellyStake
      • Staking Chests
      • Voting power
    • jAssets by BLKSWN
      • Liquidation and the Stability Pool
      • Liquidation Logic
      • Recovery Mode
      • jUSD Redemption
      • Expected User Behaviors
      • Core Smart Contracts
      • PriceFeed and Oracle
      • Contract Ownership and Function Permissions
      • Keeping a sorted list of Vaults ordered by LACR
      • Supplying Hints to Vault operations
      • Gas compensation
      • The Stability Pool
      • Swap Pools
      • Protocol System Fees
      • Governance
      • Audits
  • Jellyverse Architecture
    • Governance
    • Rewards
    • Reward Distributor
    • Tokenomics
    • Whitepaper
    • Contract Addresses
  • Audit
  • Community
    • Socials
  • COMMUNITY PROTOCOLS
    • Introduction
Powered by GitBook
On this page
  1. Protocol Library
  2. jAssets by BLKSWN

PriceFeed and Oracle

Last updated 9 months ago

The jAsset protocol utilizes as its decentralized oracle provider. The current prices are fetched from Pyth by the client and then passed to the contract mutations, which update the oracles via a Pyth interface. Consequently, the user pays the gas fee for the oracle update.

After updating the oracles, the PriceFeed assembles a price memory cache. This cache contains the prices of all relevant tokens and is used during execution. This schema optimizes gas consumption by ensuring that each price is requested from Pyth storage no more than once per execution.

If the last update of a token price is older than 5 minutes, the price feed is marked as untrusted. In this state, minting new debts is disabled, and only functions that increase the Total Collateral Ratio (TCR) and thus reduce system risk are permitted. Additionally, there is a fallback to a secondary price feed, which is directly written to the protocol by governance. This secondary feed is intended to cover pre-market and post-market hours, during which may not yet provide prices, but trading on NASDAQ has already started.

Pyth Network
Pyth Network