Golden Finance Docs
  • 🐕Introduction
    • Protocol Roadmap
  • 🧠Fundamental Knowledge
    • Trading Engine
      • Providing Liquidity
      • Margin Trading
      • Spot Swaps
    • Protocol Fees
      • Margin Trading Fees
        • Position Fee
        • Borrowing Fee
        • Liquidation Fee
      • Swap Fee
      • GLP Minting & Burning Fees
  • Tokenomics
  • Technical Material
    • RPC URLs
    • Contract Addresses
    • Price Oracles
  • Miscellaneous
    • Links & Social Media
      • Trading App
      • Telegram
      • Discord
      • Twitter
    • Brand Assets
    • Terms & Conditions
    • FAQs
Powered by GitBook
On this page
  1. Technical Material

Price Oracles

A price oracle is any tool used to view price information about a given asset.

The PriceFeed contract accepts submissions from the price feed keeper. This keeper calculates prices using the median price of Binance, Gate.io, Kucoin, OKX, Bybit, Coinbase and a few other CEXs. There are two types of keepers:

  • Price feed keeper: submits prices routinely for swaps

  • Position keeper: submits prices when executing a position

These two keepers ensure users a real-time price when they create a position or execute a swap.

To enhance the protocol's protection against incorrect pricing, a third-party oracle (Chainlink/Pyth/API3/…) serves as a Secondary PriceFeed.

The protocol uses the price from the PriceFeed if it is within a configured percentage of the corresponding Secondary PriceFeed. If the price exceeds this threshold then a spread would be created between the keeper price and the secondary price, this threshold is based on the historical max deviation of the third-party oracle price from the median price of reference exchanges.

Prices from the keeper also have an expiry of five minutes, if the last price has been submitted more than five minutes ago, the secondary price will be used instead.

Aside from the keeper nodes, watcher nodes are also ran to verify that the prices submitted by the keepers have not been tampered with. Watcher nodes continually compute the median price and compare this with the prices submitted by keepers, if the prices submitted by a keeper does not match the computed median price, then the watcher sends a transaction to enforce a spread between the keeper price and the secondary price.

PreviousContract AddressesNextMiscellaneous

Last updated 3 months ago