---
title: "Leveraging Hedera’s Architecture: Sirio’s Oracle-Free Price Feed Approach"
id: "15639"
type: "post"
slug: "leveraging-hederas-architecture-sirios-oracle-free-price-feed-approach"
published_at: "2025-01-02T08:00:00+00:00"
modified_at: "2026-02-04T00:08:12+00:00"
url: "https://hedera.com/blog/leveraging-hederas-architecture-sirios-oracle-free-price-feed-approach/"
markdown_url: "https://hedera.com/blog/leveraging-hederas-architecture-sirios-oracle-free-price-feed-approach.md"
excerpt: "By leveraging Hedera's architecture, Sirio integrates TWAP (Time-Weighted Average Price) calculations and HBAR/USD conversions, ensuring secure, resilient price feeds. This oracle-free method not only enabled seamless development but now enhances the protocol's security as a backup to traditional oracles."
taxonomy_category:
  - "Uncategorized"
taxonomy_post_tag:
  - "defi"
  - "technical"
---

[Skip to content](#content)
blog

# Leveraging Hedera’s Architecture: Sirio’s Oracle-Free Price Feed Approach

January 2, 2025

Hedera

Hedera provides secure, scalable infrastructure for real-world decentralized applications in finance, AI, and sustainability, governed by global enterprises.

Maraglino Giacomo

Co-founder & CEO, Sirio Finance

**Decentralized Finance (DeFi)** is one of the fastest-growing sectors in the **Web3 ecosystem**, reshaping how we define financial systems. At the heart of its success are critical tools like **oracles**—data providers that bring **real-world, off-chain information on-chain** to be used in **smart contracts**. Oracles integrally power the creation of various **decentralized applications (dApps)**. However, oracles have only become available on the **Hedera network** as of **Q3 of 2024**.

**Oracles** are crucial to **[Sirio Finance](https://www.sirio.finance)**, a **lending and borrowing protocol** built on Hedera. To proceed with developing our protocol without access to oracles, we developed an **alternative, oracle-free and fully on-chain mechanism**, designed to fetch information that’s typically only provided by oracles. This allowed us to construct and test our application without oracle integrations, leading us to create a **proprietary method** that we will henceforth implement in our active platform as a **backup to the oracle solution** to enhance our protocol’s security.

This article will explore our strategy to **bypass oracles** in order to fetch token prices, which could previously only be done through oracles. The development of this method was only possible due to **Hedera’s unique architecture**. Let’s dig in!

#### **How Do Oracles and Smart Contracts Work Together?**

By design, **smart contracts** are isolated programs that are deployed to a network but that cannot access or verify data outside their native network. This limitation is where **oracles** come into play, serving as a **bridge** that connects smart contracts with data from the external world. They are **decentralized entities** that gather data from multiple sources and feed it to the smart contracts to be used for **on-chain activities**. The integration of oracles into smart contracts involves the following key steps:

- **Data Request**: The smart contract generates a request for data; for example, the current price of a cryptocurrency, weather conditions, or any other real-world information.
- **Oracle Query**: The request is then sent to an oracle or a network of oracles.
- **Data Verification**: Once the data is retrieved, it undergoes a verification process.
- **Data Delivery**: Next, the verified data is fed back to the smart contract.
- **Execution**: With the necessary data as input, the smart contract automatically executes the predefined logic.

The following diagram explains how **oracles and smart contracts** work together:

#### **On-Chain Price Feeds System**

When **Sirio** started developing its protocol, **oracles** were not yet available on the **Hedera network**, which prevented the ability to query token prices. Since this is an integral part of our protocol, we developed an **alternative system** that bypasses the need for oracles to obtain the price of tokens at market value. The mechanism is structured in three steps:

1. **Get the current price of the given token in HBAR.**
2. **Calculate the mean of the historical price** over a specific interval and frequency; this mechanism is also defined as **[TWAP (Time Weighted Average Price)](https://www.rareskills.io/post/twap-uniswap-v2)**.
3. **Convert the price of the token from HBAR to USD.**

Using this mechanism, we could accurately implement **token prices at market value** within our protocol, allowing users to **lend and borrow their assets**. Let’s dive into the details!

#### **1. Token-HBAR Price**

The first step necessary to define the token’s market price is to extract its value from the **liquidity pools (LPs)** in which it’s paired. As seen in the [analytics section on](https://www.saucerswap.finance/liquidity)
**[SaucerSwap](https://www.saucerswap.finance/liquidity)**, the LPs with the most liquidity have an **HBAR pair**. To explain how we defined the price in **HBAR** of each token, refer to **SaucerSwap’s market-making architecture**, which uses the constant product function defined as follows:

***X * Y = K***Where:

- **X** = Quantity of Asset X
- **Y** = Quantity Asset Y
- **K** = Constant (**Quantity of Asset X * Quantity of Asset Y**)

The price of tokens in a **SaucerSwap LP** is determined by the ratio of the quantities of the two tokens in the pool. If you have a pool with **Token A and Token B**, the price of **Token A in terms of Token B** is calculated by dividing the quantity of Token B by the quantity of Token A, and vice versa.

Our **smart contracts** implement logic that first retrieves the latest **Token/HBAR exchange rate** for each token. Next, they convert the amount of **HBARs** needed to purchase one unit of the token into a time-weighted value using the **TWAP system**.

#### **2. TWAP System**

**TWAP**, or **Time-Weighted Average Price**, calculates the **average price** of an asset (e.g., a token) over a specific **time period**. This method ensures a more **stable** and **reliable price estimate** by considering multiple **price points** within the duration, rather than relying on a single snapshot.

One of the key advantages of **TWAP** is its effectiveness in **reducing the risk of price manipulation** by large traders, often referred to as **“whales.”** By averaging prices over a specified timeframe, **TWAP** minimizes the impact of **short-term price spikes or drops** caused by large trades or market volatility.

For example, instead of using a single price point that could be artificially influenced, **TWAP** calculates an **average** using **price data captured at regular intervals** (e.g., hourly over 24 hours). This provides a more **accurate price feed**, which is essential for protocols managing **lending, borrowing, and liquidation processes**.

**TWAP** is calculated using the formula:

***Token Price = (P1 × T1 + P2 × T2 + … + Pn × Tn) / (T1 + T2 + … + Tn)***Where:

- **P1, P2, …, P24** represent the **token prices** captured at **regular intervals** (e.g., every hour over 24 hours).
- **T1, T2, …, T24** represent the **time intervals** corresponding to each **price observation**.

Using this formula, we calculate the **Time-Weighted Average Price (TWAP)** for all our assets. This approach considers the **prices (P)** and **time intervals (T)** over the past 24 hours, with **data points captured every 1 hour**.

#### **3. HBAR/USD Conversion**

After calculating the **time-weighted amount of HBAR** required to purchase one unit of each token, we convert it into its **dollar equivalent** using the **HIP-475 System Contract**. **HIPs** are pre-compiled contracts designed to streamline interactions with **Hedera** through the **Solidity programming language**. **HIP-475** specifically uses **[Hedera’s Exchange Rate Tool](https://hedera.com/blog/how-hedera-calculates-the-hbar-usd-exchange-rate-for-sdks-and-applications)
 (ERT)** to determine the **HBAR/USD exchange rate**.

For each token, we call a **HIP-475 function** that takes an **HBAR quantity** as input and returns the corresponding value in **USD**.

We use the following **function** to make the conversion:

```
interface IExchangeRate {
function tinybarsToTinycents(uint256 tinybars) external returns (uint256);
}
```

**The function’s output** is the **Token/USD Exchange Rate**, ready to be used in our **smart contracts**. We can resume the three steps mentioned above in the following **diagram flow**:

This approach ensures that **token prices** are accurately determined in a **secure** and **decentralized manner**, forming a reliable foundation for our protocol’s **lending and borrowing functionalities**.

#### ****Conclusion****

The journey to building a **decentralized** and **secure lending and borrowing protocol** on **Hedera** has been both **innovative** and **adaptive**. Faced with the absence of **oracles** during the initial stages of development, **Sirio Finance**engineered an **oracle-free**, fully **on-chain solution** that reliably calculates **token prices** using **TWAP** and **Hedera’s unique architecture**. This system not only enabled the protocol’s **development and testing** but also now serves as a **robust backup mechanism** to complement **Hedera’s newly available oracle integrations**.

By combining **oracle solutions** with our **proprietary price-fetching mechanism**, **Sirio Finance** ensures enhanced **reliability**, **resilience**, and **security** for its users. This **dual-layered approach** underscores our commitment to leveraging **Hedera’s cutting-edge features** while continuously optimizing our protocol to provide a **seamless DeFi experience**. With these innovations, we are proud to set new standards for **transparency** and **robustness** in **DeFi finance**.

#### **About Sirio**

**[Sirio Finance](https://www.sirio.finance)** is a **pioneering lending and borrowing protocol** that leverages **AI** to revolutionize **risk management**. At its core, the team is developing an **advanced machine-learning algorithm** to mitigate **liquidation events** seamlessly and **permissionlessly**.

With a strong focus on **user experience** and **cutting-edge risk management**, **Sirio’s proprietary machine-learning model** sets a new standard in the industry. The protocol’s vision extends to **decentralizing** and **open-sourcing** this technology, reinforcing its commitment to advancing **decentralized AI solutions**.

This **forward-thinking approach** has fostered**key partnerships**across the ecosystem, including collaborations with**[Filecoin](https://filecoin.io/)
, [HbarSuite](https://hbarsuite.app/#/dashboard)
, [HashPack](https://www.hashpack.app/)
, [SaucerSwap](https://www.saucerswap.finance/)**and **[Kabila](https://kabila-website.webflow.io/)
.** Sirio’s innovation has also earned recognition through a **grant from [The HBAR Foundation](https://www.hbarfoundation.org/)**, solidifying its position as a leader in the **decentralized finance space**.

**Sirio aims to launch on mainnet by the beginning of 2025.** Before we go live, we invite you to become familiar with our [Testnet version.](http://testnet.sirio.finance)

To get involved in the **Sirio community** and stay in the loop on incoming opportunities, we invite you to **join our Discord Server** or **[follow us on X](https://x.com/SirioFinance)**; you can also check more **[resources from Sirio](https://www.sirio.finance)** (**testnet**, **website**, **Medium**, **social media**, etc.).

[Back to Blog](/blog)

discover

See more articles

[View All](/blog)

August 5, 2026

### Details decide. What digital asset policy did in July 2026

Halfway through 2026, the regulatory picture is coming into focus. Hedera Chief Policy Officer Nilmini Rubin and VP Global Policy Isadora Arredondo break down what moved in June across the

[Read More](https://hedera.com/blog/details-decide-what-digital-asset-policy-did-in-july-2026/)

July 17, 2026

### Deploy Multichain Dapps on Hedera in 60 Seconds with scaffold-hbar

Deploying multichain dapps on Hedera has never been easier! With just one command, you can spin up a fully functional dapp using Next.js, Hardhat or Foundry, and AI agent context…

[Read More](https://hedera.com/blog/deploy-multichain-dapps-on-hedera-in-60-seconds-with-scaffold-hbar/)

July 13, 2026

### Regulation is finding its form in summer 2026

Halfway through 2026, the regulatory picture is coming into focus. Hedera Chief Policy Officer Nilmini Rubin and VP Global Policy Isadora Arredondo break down what moved in June across the

[Read More](https://hedera.com/blog/regulation-is-finding-its-form-in-summer-2026/)

## Ready to get started?

Discover why Hedera is the trusted institutional-grade network powering the new digital economy.

[Start Building](/start-building)

[Contact](/contact)

We use cookies to deliver the best experience on our website and to analyze traffic. By continuing to use this site, you consent to our cookie policy.

Review our [Privacy Policy](/privacy)
 to understand how Hedera collects and uses information.

Accept All CookiesAccept Necessary Cookies
