Data Verification Mechanism (DVM) 101
What the DVM is, and How You Can Participate
What are Oracles?
Blockchain oracles are specialized services that provide smart contracts with information outside of the blockchain world. As such, they are the connection point that give blockchains inputs on real world events, non-crypto asset prices, and so on. This type of “off-network” data is crucial for various types of contractual agreements, as these real world events may be the trigger for transactions. Oracles are a crucial part of the blockchain ecosystem, and without them, smart contracts would be limited to the data within their own networks.
There you have it: oracles are the data feed to smart contracts. But there are different types of oracles designed for various purposes. Everything from hardware sensors to people with special knowledge can be used to serve this purpose. Different types of oracles have different features, such as: source, direction of information, and trust. Is the information generated from software or hardware? Is it “inbound” or “outbound”? Is the source centralized or decentralized? All of these questions must be answered in order to determine the right type of oracle to use.
The “Oracle Problem”
The problem with oracles is that far too often they are centralized. Since blockchains are not able to access outside data, relying on a single point of data from a single origin becomes a vulnerable weak point for smart contracts. Remember, the main purpose of a smart contract is that it is decentralized, and decentralization is only as good as its weakest link. If the data that an oracle entered onto the blockchain was corrupted somehow, it could have disastrous effects. Once data is on a blockchain, it becomes an immutable part of the chain history.
The importance of decentralized oracles is underscored by a series of incidents that occurred in February of 2020, when an infamous attack on a budding DeFi sector took place. Powered by Aave flash loans, a user was able to drain $350,000 worth of Ether from bZx’s lending platform Fulcrum. This was made possible by using a massive amount of borrowed funds to manipulate markets, thereby changing the price feeds (and therefore lowering the amount of borrowed funds owed for repayment). These attacks drained bZX of nearly $1 million over two separate occasions.
UMA’s Unique Approach
The above scenario shows that even on-chain oracles (price feeds) can be corrupted with enough working capital. This corruption has cascading negative effects, and must be avoided at all costs. But Blockchain is the Wild West of finance, where anything goes. Technically, the “attackers” in the previous example did nothing wrong — they simply exploited a flaw in the system for profit. They played by the rules and won, bigtime.
Murphy’s law states that, “Anything that can go wrong, will go wrong.” This is especially the case when “going wrong” is incentivized by profit. To avoid this being the case, UMA employs a simple economic framework to ensure that the profit made from corrupting the DVM is always less than the cost of corrupting the DVM.
The oracle that UMA uses is called the DVM, which stands for Data Verification Mechanism. The DVM is UMA’s way of implementing a decentralized, permissionless oracle system, made secure by economic incentives. UMA’s DVM is composed of its community of token holders. Quite literally — you as a UMA holder are a part of the DVM. When an oracle price feed request is made, UMA token holders must manually calculate a price ratio and vote on their answer, staking their UMA tokens in the process. If their answer is correct, they are paid a voting reward. Likewise, if their answer is found to be incorrect there is no penalty, other than no rewards received..
Calculating the cost of corruption is simple: simply tally the value of 51% of UMA tokens at any given moment. Right now, UMA’s market cap is over $400M, which means an attacker would need at least $200M worth of UMA tokens or would need at least $200mm to bribe 51% of token holders to conduct a successful attack. This is similar to a 51% attack on a Proof of Stake network. Measuring the potential profit from corruption is a bit trickier. This would be found by measuring the amount of funds that could be potentially stolen if the smart contracts that reference the DVM were corrupted.
In order to maintain that it is never profitable to corrupt the oracle, the DVM contains a mechanism to ensure that 51% of available UMA tokens is always more valuable than the potential profit of corrupting the DVM. This mechanism is constantly monitoring this ratio, and conducts strategic token buybacks using the funds collected from protocol fees to keep the UMA token price above the required threshold. All of the UMA that is bought from the market is subsequently burned — removing it from circulation forever.
How To Participate
Now that we understand what Oracles are, their importance to the Blockchain Ecosystem, and that you yourself can be a part of the UMA DVM, it’s crucial that you know how to participate. We are going to take a look at a couple examples of price requests, and walk through how to make the calculations for an accurate vote!
Example 1
Calculating Prices for a USDETH price request:
For all USDETH price calls, we take the opening candle value from Kraken, Binance and Coinbase Pro at a given time and round to 5 decimal places. As an example, let’s take the recent price request of USDETH@ 10PM UTC Sep 30.
Step 1: Find the ETH/USD Price for Each Exchange at the correct time.
Our first step is to identify the price of Ethereum at each of our source exchanges for the requested time. To do this, you can go to the exchanges directly, or use a tool such as Trading View. Here are the results:
Kraken ETH/USD 1H Candle Chart, taken from TradingView
According to this chart, the price of ETH/USD at 22:00 UTC on Sep 30 was $357.01.
Binance ETH/USDT 1H Candle Chart, from Trading View.
According to the chart, the price of ETH/USDT at 22:00 UTC on Sep 30 on Binance was $357.32.
Coinbase ETH/USD 1H Candle chart, from Trading View
According to this chart, the price of ETH/USD at our desired time was $357.15.
Tabulating our values, we have:
Kraken: $357.01
Binance: $357.32
Coinbase: $357.15
Step 2: Converting ETH/USD to USDETH
Notice that our price request is USDETH, not ETH/USD. If you were to vote using the above values, your vote would not be correct. Instead of getting the value of ETH measured in USD, we want the value for 1 USD measured in ETH. To get this value, we simply take the inverse of our measured numbers.
Kraken: 1/357.01 = 0.002801041987619
Binance: 1/357.32 = 0.002798611888503
Coinbase: 1/357.15 = 0.00279994400112
Step 3: Take the Median
Notice that while our values are close, they are not exactly the same. To get to our final answer, we must take the median of our measured numbers. To make this easy, a good online median calculator is available here. Simply enter the numbers (separated by commas), click “submit data” and record the result. Here is the answer I got:
Step 4: Round to the appropriate decimal place.
Recall a few paragraphs ago when I said that for USDETH price votes we round to the fifth decimal place. With the result of .002799944001119977, the correct rounding would be 0.00280. This is our final answer, and is consistent with the community consensus for this vote.
Example 2
Calculating prices for a USDBTC votes.
This calculation will follow the same process used in example 1, but for BTC price votes we round to 9 decimal places instead of 5. Additionally, the exchanges used for price sourcing are Binance, Coinbase and Bitstamp. For this example, we will be looking for the USDBTC price at 10PM UTC on September 30.
Step 1: Find the BTC/USD Price for Each Exchange at the correct time.
Coinbase BTC/USD 1H Candle Chart from Trading View.
According to our chart, we found the price of BTC/USD on Coinbase to be $10,707.38 at the requested time.
Binance BTC/USDT 1H Candle Chart from Trading View.
According to Binance, the price of BTC/USD at the requested time is $10,710.92.
Bitstamp BTC/USD 1H Candle Chart from Trading View.
Lastly according to Bitstamp, the price of BTC/USD at the requested time was $10,703.77.
Tabulating our values, we have:
Coinbase: $10,707.38
Binance: $10,710.92
Bitstamp: $10,703.77
Step 2: Convert BTC/USD to USDBTC
Again, we want to know the value of one dollar measured in BTC, not the value of one BTC measured in dollars. To get this number, we simply take the inverse of our collected values.
Coinbase: 1/10,707.38 = 0.000093393528576
Binance: 1/10710.92 = 0.000093362661657
Bitstamp: 1/10,703.77 = 0.000093425026883
Step 3: Take the Median
Using the same tool mentioned in Example 1, we get the following result:
Step 4: Round to 8 decimal places.
Taking our Median value of .000093393528576 and rounding to 8 decimal places, we get a final answer of:
0.00009339
This answer is accurate to what the community found at the time of this vote.
Conclusion
Oracles are a critical part of blockchain, and in the case of UMA you are the oracle! Therefore, it is critically important that you are able to make precise calculations, and that you participate in governing the UMA ecosystem. If you vote correctly, there’s a nice monetary reward in it for you, too!
For additional questions or if any help is required in making calculations, feel free to ask in the UMA community chat over in Discord! Happy voting.