V3 Data Feeds: A Closer Look Into Switchboard Functions

Switchboard
Switchboard
Published in
2 min readOct 23, 2023
V3 Data Feeds: A Closer Look Into Switchboard Functions

Switchboard has redefined the concept of data feeds in the world of oracles. It’s not just about fetching and providing data; it’s about enabling developers to create custom data feeds that can do so much more. In this article, we’ll dive deep into the Switchboard Data Feed, exploring its capabilities and how it can be harnessed for a wide range of applications.

A Data Feed is a Function

At the heart of this innovation is the understanding that a Data Feed is essentially a Function. With Switchboard V3, a Function can be deployed to perform the role of a data feed, a randomness generator, automation, and more. This dynamic nature allows developers not only to customize data sources but also to manipulate the data before sending it on-chain.

Price Indicators and Other Data

Functions go beyond basic price data. It enables developers to account for various price indicators and bands. This includes metrics like VWAP (Volume-Weighted Average Price), EWMA (Exponential Weighted Moving Average), and others. By incorporating these indicators, developers can provide users with a competitive “fair value market.” Alternatively, it can calculate a set of risk scores and adjust protocol parameters to safeguard users.

Aggregate Multiple Data Points On-Chain

Every Function execution emits a verify transaction and a transaction which executes your desired instruction on-chain. This means that developers can aggregate data for multiple market and update them on-chain simultaneously.

Choose Between Routine and Callback Models

Switchboard offers flexibility in execution. Functions can run on a Routine (cron scheduled) or Callback (on-demand) model. Routine execution involves scheduled intervals, while Callback execution happens in real-time when triggered. The Callback model ensures the freshest data is propagated on-chain and prevents front-running. For example, a user’s trade triggers a Function to fetch data and subsequently updates on-chain data while settling the user’s trade.

Access Private Data Through Switchboard Secrets

One of the most groundbreaking aspects of the Switchboard Data Feed is its ability to access private or gated API data securely. This is made possible through Trusted Execution Environments (TEEs), ensuring data privacy and security. Developers can utilize Secrets to access private data sources, opening up possibilities for building markets related to forex, insurance, sports events, and much more.

To conclude

Data Feeds can be built via Functions, it is not just a conventional data layer, it is a customizable execution layer that enables developers to craft custom data feeds that tailor fit to their product requirements. The breakthrough of our Smart Oracles paves the way for more sophisticated and flexible smart contract development.

Contact us: https://switchboard.xyz/contact

Twitter: https://twitter.com/switchboardxyz

Discord: https://discord.gg/switchboardxyz

Github: https://github.com/switchboard-xyz

Docs: https://docs.switchboard.xyz

More links: https://linktr.ee/switchboardxyz

--

--