The Curious Case of Cardano Oracles
Why Oracles are so Important to building DeFi

In the world of DeFi, Oracles must be functional, accurate, and unmanipulable.

The reality of the above is that as with everything in the world, there are tradeoffs and no current oracle protocol can embody this. Cardano, unfortunately, is in a swirl given that no longstanding, tried-and-true Oracle providers are deployed or that homegrown solutions have been slow in development. Live DeFi protocols in Cardano are exposed due to the limitations of using DEX-provided price oracle feeds.


Why Are Oracles Important?

DeFi protocols allow users to leverage financial tools and derivatives such as swapping, lending/borrowing, synthetic assets, and stablecoins to name a few. A key part of that interaction between the user and protocol is ensuring that transactional values of what is coming in and going out are the same. This might sound abstract, but an example would be a simple swap of ADA to USD. If the "market rate" of ADA is $0.50 and you want to swap $100 for ADA, you'd expect to get roughly 200 ADA. The key part of an Oracle is to ensure that the correct market rate is being implemented in that transaction to protect both the interests of the user and the protocol. The concept of a market rate is outside the boundaries of what a blockchain can "see" or "know". The Oracle is responsible for getting off-chain information (i.e. the market exchange rate for USD-ADA in this example) and supplying it for usage in on-chain transactions. This makes having a functional and accurate oracle really important for any blockchain that hopes to have a strong DeFi presence.

What kind of Data can an Oracle Provide?

The beauty of the Oracle concept is that any "type" of off-chain data can be supplied to be used on-chain. This could range from real-world physical measurements to scores and results of sporting events, to market exchange rates. The type of data that can be used is limitless as long as a robust protocol can be designed to get it on-chain and exposed to be used. Below are common types and examples of data types:

  • Hardware-derived (physical measurement): measured rainwater, wind speed, RF-signal strengths, QR codes
  • Software-derived (calculation or call): sports game score, exchange rate of ADA-USD, points systems

Centralized vs Decentralized Oracles?

Oracles can also come in two different flavors in how they are implemented. A centralized oracle network is controlled centrally by a singular entity, running multiple instances of nodes for redundancy and scaling. A decentralized node is one where independent parties run the software that powers the node network. Compared to a centralized oracle network, there are no single points of failure (i.e. if something happens to one node operator, the system will continue to operate). There are obvious benefits to decentralization, ensuring no manipulation, or single points of failure, and minimizing the trust necessary to use them in good faith.

Types of Oracles Projects Can Use

DeFi projects leverage various types of Oracle solutions to help ensure that price feeds that power their protocols are accurate, precise, and timely. They come in the following varieties:

  • Input Oracle Networks - Chainlink, Pyth, or Tellor are the largest Oracle networks by assets secured. They are composed of various data sources and use algorithms to aggregate the sources into a single price data point for reliability and accuracy. Network node operators then pass that to the blockchain supported where smart contract interactions can pull the needed price feed from the oracle.
  • DEX Price Feeds - Popularized largely from Uniswap v2 LP pools, by knowing the ratio of tokens in a particular liquidity pool and the total value of the pool at any time can give an estimation of the price of either token in the pool. This can be used as a singular price feed given it's direct relation to market activity with sufficient liquidity. Another variation is TWAP (time-weight average price) Oracles, which reduces the chances that the price can be manipulated since it takes a time-weight approach to minimize large price swings.
  • 3rd Party Price aggregation - Service providers such as CoinGecko and CoinMarketCap can also serve as price feeds, although these can be leveraged very easily through APIs, they also pose risks as they can be updated or modified by the source provider at any moment.

The Current State of Oracles

In Cardano, the options available for Oracle networks are very slim. Right now the only two native Cardano oracle projects in development or in flight are Charli3 and OrcFax, with the latter recently having to suspend its price feeds due to a dependency that isn't supported anymore. Most inflight DeFi Projects in Cardano utilize DEX price feeds and/or 3rd party feeds. Projects are taking these various price feeds and wrapping them up into their custom Oracle solution. This isn't a sustainable solution for projects to manage since the inputs could change (ie a DEX updates a pool, a 3rd party alters the API, etc...) incurring lots of technical debt. It also detracts the team's attention from the task at hand the building and improving the project. Although Charli3 and OrcFax are new projects to launch, they need to be weathered before they can attain people's level of trust that they have with a Chainlink or Pyth price feed. This is expected but begs why Chainlink or Pyth haven't been integrated into Cardano. No real answers, but if you talk to any DeFi project teams the challenge around getting accurate price feeds is daunting.

Right now Intersect has recently created a working group for Oracles. Anyone interested can join that buy hopping into the Intersect Discord. Also the Butane team is working to build out an open source oracle solution. The attitude and effort is in the right direction, just more work needs to be done to help ensure the economic security on Cardano DeFi.

Leave a Reply

Your email address will not be published. Required fields are marked *