# 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](https://chain.link/), [Pyth](https://pyth.network/).
* **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.&#x20;

{% hint style="info" %}
In the [Hub and Spoke model](/xlending/architecture.md#hub-and-spoke-structure), 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.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.xapp.folks.finance/technical-details/oracle.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
