paint-brush
Exploring the Economic Security of On-Chain Oracles: Key Insights from Uniswap Labsby@oraclesummit
125 reads

Exploring the Economic Security of On-Chain Oracles: Key Insights from Uniswap Labs

by Blockchain Oracle SummitMarch 11th, 2024
Read on Terminal Reader
Read this story w/o Javascript

Too Long; Didn't Read

In the presentation below, Xin Wan, a researcher at Uniswap Labs, presented on the economic security of on-chain oracles and the trade-offs to consider in designing better oracle networks. Below is a glossary of key concepts mentioned during Xin’s talk.
featured image - Exploring the Economic Security of On-Chain Oracles: Key Insights from Uniswap Labs
Blockchain Oracle Summit HackerNoon profile picture


In the presentation below, Xin Wan, a researcher at Uniswap Labs, presented on the economic security of on-chain oracles and the trade-offs to consider in designing better oracle networks.

Below is a glossary of key concepts mentioned during Xin’s talk, intended as a supplement to his video presentation.


WHAT IS UNISWAP?

Uniswap is a decentralized cryptocurrency exchange that runs on the Ethereum blockchain and utilises smart contracts to allow users to trade and swap tokens. It was founded in November 2018, and its native token, $UNI, was launched in September 2020 to grant holders governance rights.

ORACLE LIVELINESS AND LATENCY

Oracle liveliness is the ability of an oracle to provide real-time and up-to-date data to smart contracts or decentralized applications (DApps). Lively oracles are consistently updated and are, therefore, considered more accurate and reliable. However, security measures should be implemented to ensure that the liveliness of an oracle network does not compromise the quality of the data provided.


Oracle latency refers to the time delay experienced by oracles between data collection in the real world and information provision to smart contracts or dApps on the blockchain. During this time delay, processes like data aggregation, verification, and blockchain consensus occur. Low latency is a desirable feature in oracle networks for some use cases.

PROOF OF STAKE TRADE-OFFS

Proof of Stake (PoS) is a consensus mechanism that involves choosing validators to create blocks and validate transactions based on the number of coins or tokens they have locked up as collateral. PoS is widely considered to be a more energy-efficient and scalable alternative to Proof of Work (PoW). In addition, it offers protection against 51% attacks and Sybil attacks.


However, there are a few potential security issues in using PoS consensus mechanisms, such as the loss of decentralization, as the network may become controlled by a few individuals with a significant amount of staked tokens. In addition, in some PoS protocols, the identities of the next block proposers are known in advance for a certain number of blocks. This could lead to price manipulation and targeted attacks.


PoS protocols often employ measures such as validator rotation, randomization of block proposers, and coin-slashing penalties to mitigate such malicious behavior.

LIQUIDITY POOLS, PROVIDERS, AND DISTRIBUTION

Liquidity pools are funds locked in smart contracts and used to facilitate decentralized trading and lending. These pools are supplied by users called liquidity providers (LP), who earn a percentage of trading fees in exchange for their contribution.


In a DEX like Uniswap, liquidity distribution describes the supply of assets or tokens across different liquidity pools by liquidity providers. Liquidity distribution can change over time due to market demands, arbitrage opportunities, protocol updates, or changes in token value. These changes can happen frequently as participants migrate from one pool to another in response to market conditions and incentives.

BASIS POINT

A basis point is a unit of measurement commonly used in finance to represent one-hundredth of one percentage point, i.e., 0.01%. It is instrumental in expressing fractional changes and conducting precise and standardized experiments. In his presentation, Xin used basis points to analyze the manipulation cost for on-chain oracles.

UNISWAP V4 HOOKS

Hooks in Uniswap v4 are external contracts that execute specific actions at certain points during the execution of a liquidity pool. Typically, liquidity pools on Uniswap follow a strict sequence called a lifecycle, starting with the pool creation, then liquidity adjustment, token swapping by users, and other processes.


With the introduction of hooks, developers can now add custom code to pools at specific moments during a pool’s lifecycle, like beforeSwap and afterSwap, which allow developers to perform a designated action before or after a swap.


In addition, Uniswap v4 hooks can be used to create dynamic fees based on volatility or other inputs, set on-chain limit orders, or auto-compound LP fees back into the LP positions. Hooks provide flexibility and customization options for developers to control how pools, swaps, fees, and LP positions interact.



Learn more about Uniswap Protocol here:

Uniswap Website
Uniswap Documentation
Uniswap Twitter
Xin Wan Twitter



The Blockchain Oracle Summit is the world’s only technical summit that dives deep into the use cases, limitations, and impacts of oracles on the wider blockchain ecosystem. Leading speakers worldwide gathered in Paris to share their work and experience building and using oracle solutions. Article by Michael Abiodun.


Also published here.