Oracle

Oracle is a crucial component in decentralized finance (DeFi) as it provides external data to smart contracts. Folks Finance uses an architecture that provides feeds that are:

  • Secure: delivered by the most trusted oracle protocols e.g. Chainlink, Pyth.

  • Reliable: the prices, provided by multiple oracles, must be coherent i.e. not differ by more than a certain threshold.

  • Up-to-date: each price must have been updated within a certain time threshold.

In order to accomplish this, Folks Finance relies on:

  • Chainlink: a decentralized oracle network that enables smart contracts to interact with real-world data securely. It uses a network of independent oracles to fetch and verify external data, ensuring high security, reliability, and tamper-proof data inputs.

  • Pyth Network: a specialized oracle network designed to provide high-fidelity, low-latency financial market data to smart contracts. It focuses on delivering real-time price feeds from a consortium of leading trading firms, exchanges, and other financial institutions.

In the Hub and Spoke model, feeds are only needed in the Hub, where the protocol pools and logics are located. Each pool is directly linked to an asset, and as a result, to its feed. The OracleManager contract allows for the retrieval of an asset's price directly from its pool id, which can then be used in the protocol. This contract interacts with the NodeManager, which is responsible for fetching the feeds from the mentioned oracles and carrying out defined checks such as staleness and price threshold.

Last updated