> For the complete documentation index, see [llms.txt](https://docs.xapp.folks.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xapp.folks.finance/technical-details/oracle.md).

# 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/), [DIA](https://www.diadata.org/).
* **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;
* **DIA**: a trustless oracle network that delivers verifiable data feeds to onchain applications, auditable from source to chain. It sources first-party trade data directly from over 100 exchanges and publishes each feed with a fully inspectable methodology, covering both digital assets and tokenized real-world assets.

{% 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
