Back
Omer Goldberg
Omer Goldberg

Uniswap v3 TWAP Oracle Tooling and Deep Dive Pt. 1

Cover Image for Uniswap v3 TWAP Oracle Tooling and Deep Dive Pt. 1
  1. Overview
  2. Dependencies Everywhere
  3. Oracles as attack vectors
  4. Oracles: Onchain vs. Offchain
  5. Uniswap V3 TWAP Oracles
  6. Ticks & Price
  7. Why Should I care about TWAP Oracles?
  8. Ok, TWAPs are secure, but how do I use them?
  9. What's next? ⏭️
  10. About the Uniswap Grant Program

The initial Uniswap Grants was announced here

Overview

Chaos Labs is a cloud platform that specializes in Economic Security for DeFi protocols. At Chaos Labs we build agent- and scenario- based simulations to battle test protocols in adversarial and chaotic (🤗) market conditions. In our quest to build state of the art simulations and security tooling we also partner with DeFi protocols to build valuable tools for the DeFi developer ecoysystem. This series of posts is a technical deep dive on Uniswap v3 TWAP oracles. Our implementation for configuring Uniswap v3 TWAP return values can be found here. PRs are welcome!

Dependencies Everywhere

DeFi protocols are composable (money legos) by nature. The upside of composability is creativity and faster development iterations. The downside is that composability comes at a price. Each module or protocol that a dApp consumes is a new depenedency.

Each dependency is an attack vector. Every vector is an opportunity to dictate and manipulate internal application state in unexpected ways.

Oracles as attack vectors

Oracles are one of the largest risks to application security and integrity. Oracles provide data which are consumed by applications as an absolute source of truth. If we view applications as a state machine with different parameters, many critical states are only reachable as functions of values returned by an oracle.

For this reason, Chaos Labs invests a lot of resources into building robust tooling for interfacing with oracles. The impact of building tooling to configure oracles is two-fold:

  • Economic Security - By controlling the return values of oracles we can accurately simulate black swan events, cascading asset prices and market volatility.
  • Cyber Security - Contracts that hold billions of dollars in assets cannot afford the luxury of a safe oracle assumption. We now have the ability to configure malicous or faulty oracle return values and test the response of various applications.

This series of blog post focuses on Uniswap v3 TWAP Oracles. Part 1 is an introduction and the following posts will be a technical deep dive.

Oracles: Onchain vs. Offchain

Before jumping into the technical let’s quickly review the difference between onchain and offchain oracles.

Off-Chain Oracles

Node operators submit a price. A medianization process is triggered which results in a price consensus or average, usually through a decentralized trusted network. From there the different dApps can consume that data and trust it to be honest as long as they trust the integrity of the Oracles.

We’re going to review this architecture in-depth in our up coming series about Chainlink Oracles. Stay tuned!

On-Chain

Derive the information (prices) based on on-chain information like the ratio of supply and demand in a trading (AMM) pool. A good example for this type of Oracles is Uniswap V3 TWAP Oracles.

Uniswap V3 TWAP Oracles

All Uniswap V3 pair pools can serve as price oracles, offering access to historical price and liquidity data based on trades in the pool.

Historical data is stored as an array of Observations structs. Like their name suggests, Observations store the information observed by the Pool when a trade is executed. Observations are written to memory on a per block basis (if a trade occurs). Using two Observations we can derive the time weighted average price, amongst other things.

First lets look into what each observation instance stores:

struct Observation { // the block timestamp of the observation uint32 blockTimestamp; // the tick accumulator, i.e. tick * time elapsed since the pool was first initialized int56 tickCumulative; // the seconds per liquidity, i.e. seconds elapsed / max(1, liquidity) since the pool was first initialized uint160 secondsPerLiquidityCumulativeX128; // whether or not the observation is initialized bool initialized; }

So where’s the price 🤔? The price can be derived from the tickCumulative Let’s understand what ticks are and how they’re used to calculate prices.

Ticks & Price

In traditional finance, a tick is a measure of the minimum upward or downward movement of the price of a security. Uniswap v3 employs a similar idea: compared to the previous/next price, the minimal price change should be 0.01% = 1 basis point. Resulting in the following method to derive the price from a tick:

Price(tick) = 1.0001^tick

We know what a tick is, but what’s a tickCumulative? - the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp.

So how do we use the tickCumulative from the observations to get the price? As the name TWAP (Time Weighted Average Price) suggests we can calculate the (average) price over a period time, for that we would need 2 observations, two reference points to conclude an average value from. Using the 2 observations we can calculate the average tick and then using the formula above get the average price. Let’s use an example:

Let’s say we have

  • 2 observations, 10 seconds apart
  • tickCumulatives
    • t1: 100,000
    • t2: 200,000

The average tick would then be:

$(200,000-100,000)/10 = 10,000.$

The average price over that time period is:

$Price(tick) == Price(10,000) === 1.0001 ** (10,000) ≅ 2.7181.$

Why Should I care about TWAP Oracles?

So we know how to calculate the prices from two observations but how do we get the price from the Uniswap V3 Pool and why would we choose to use TWAP oracles?

Let’s first start with the ‘why’ - because TWAP oracles are very hard to manipulate by an attacker assuming enough liquidity in a given pool. How do we measure the difficulty of an attacker to influence the price in a TWAP oracle? There are two factors that we use to determine the attack difficulty:

  1. Funds
  2. Time

Funds

The amount of money the attacker has to pour into the trading pool in order to move the price in the direction they desire. If the pool has deep liquidity, that amount can be in the hundreds of millions and more, but that’s not enough. With Flash Loans attackers can, in the scope of a single block, get access to these funds. So how do we protect against it?

Time

interfacing with the TWAP oracles requires the user to pick the time frame for the desired price. So let’s say we ask for the average weighted price over a period of 5 minutes. Attackers attempting to change the price in pool to a desired price X, need to maintain that price for 5 minutes.

But Flash Loans cannot be extended over a single block. So now the attacker needs to keep the desired price over multiple blocks and therein lies the catch. Now the attacker needs to provide real liquidity. So let’s say our ambitious hacker ponies up the funds. Once a block has been mined everyone on the network can see the price manipulation. Any deviation in price is a ripe opportunity for arbitrage. Multiple bots will fight over the opportunity to close this arb. Now the attacker has to drive the price against market, dumping more money into the pool and competing against arbitrageurs.

In case you want more precise figures on how difficult it is for an attacker to manipulate TWAP oracles I recommend reading this research paper Manipulating Uniswap v3 TWAP Oracles by Michael Bentley.

Ok, TWAPs are secure, but how do I use them?

Now that we understand how TWAP oracles work and why they’re difficult to manipulate, let’s dive into how we work with them.

The first step is to select a time interval when querying a TWAP oracle. Longer intervals can make us more resilient to potential attackers or extremely volatile price changes. The tradeoff of longer intervals is that prices are less ‘fresh’ - meaning that current spot price can be a bit different from the average weighted price over 5 minutes if the price was continuously changing during that time frame. Because of this, picking the right interval should be based on tradeoffs your application is willing to make. Do you need the most current price at expense of being sensitive to price spikes? Or do you prioritize the weighted average over precision?

For the sake of the example we will pick a TWAP interval of 5 minutes - 300 seconds. Notice that the interval is counted in seconds on Uniswap Oracles.

Now we need 2 Observations with a 300 seconds interval between them, the first needs to be the latest observed. How do we get these? Pretty simple, let’s look at the Uniswap V3 Pool docs:

Ok so we can call Observe() or observations(), what’s the difference?

observations() - the Pool holds a (changeable up to 80) number of observations. The observations function will allow us to access them by index. However, that doesn’t help much because the observations are placed in a cyclic array, meaning that the latest observation can be anywhere depending on the Pool state. We can get that information from the Slot0 data structure but we we’ll touch on that later.

observe() - is more suitable for our needs for 2 reasons. The interface to the observe function allows us to provide an array of secondsAgo - seconds that passed from the current block timestamp. In our example calling Observe([0,300] will give us 2 Observations with 300 seconds apart, exactly what we needed!

But it’s not all it does, and that’s the cool part. Like we mentioned the Pool records an observation per block if a trade occurred within that block. So what happens if there wasn’t any trade recently or at the specified time we want? That’s an issue - we can’t be sure that we have an observation on the latest block or the block with a timestamp of exactly 300 seconds ago. To solve for this the contract will use a binary search algorithm to find the closet observations to the desired timestamps and will then extrapolate based on the closet observations to return an estimated observation at the requested timestamps.

Great, so the observe function is what we need. It will return the extrapolated tickCumulatives for the requested secondsAgo array input - giving us all the data we need to fetch the price. Now we just need to calculate the price using our knowledge of how prices are calculated from ticks.

To make our life easier the code snippet below serves as an implementation reference to fetch the caclulated price directly from any Uniswap v3 Oracle:

import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol"; import "@uniswap/v3-core/contracts/libraries/TickMath.sol"; import "@uniswap/v3-core/contracts/libraries/FixedPoint96.sol"; import "@uniswap/v3-core/contracts/libraries/FullMath.sol"; contract TWAPPriceGetter { function getPrice(address poolAddress, uint32 twapInterval) public view returns (uint256 priceX96) { if (twapInterval == 0) { (sqrtPriceX96, , , , , , ) = IUniswapV3Pool(poolAddress).slot0(); return FullMath.mulDiv(sqrtPriceX96, sqrtPriceX96, FixedPoint96.Q96); } else { uint32[] memory secondsAgos = new uint32[](2); secondsAgos[0] = twapInterval; secondsAgos[1] = 0; (int56[] memory tickCumulatives, ) = IUniswapV3Pool(poolAddress).observe(secondsAgos); uint160 sqrtPriceX96 = TickMath.getSqrtRatioAtTick( int24((tickCumulatives[1] - tickCumulatives[0]) / twapInterval) ); return FullMath.mulDiv(sqrtPriceX96, sqrtPriceX96, FixedPoint96.Q96); } } }

As we can see in the code above we handle the edge case of a 0 seconds twapInteval by fetching the current tick saved on Slot0 data in the contract, though we don’t recommend using TWAP oracles like that. Assuming a twapInterval that is bigger than we create the input secondsAgo array for the observe functions and fetch the tickCumulatives. We then use Uniswap utility functions to get the price out of the average weighted tick.

Notice that prices on Uniswap v3 are always scaled up by 2⁹⁶, which is the reason why I add the suffix X96 to all price-related variables.

In case you want to get the price of Uniswap V3 TWAP oracles on Javascript applications Uniswap has provided the https://github.com/Uniswap/v3-sdk with the same utility functions provided for the v3-core.

What's next? ⏭️

Our next post will explore TWAP architecture as well as our implementation for configuring the return values of Uniswap v3 TWAP Oracles in a development environment. Stay tuned!

About the Uniswap Grant Program

If you want to learn more about the Uniswap Grants Program, check out their blog.


Recent Updates

Cover Image for Oracle Risk and Security Standards: Network Architectures and Topologies (Pt. 2)

Oracle Risk and Security Standards: Network Architectures and Topologies (Pt. 2)

Oracle Network Architecture and Topologies provides a detailed examination of how Oracle Networks are structured, data’s complex journey from source to application, and the inherent security and risk considerations within these systems. Through a deep dive into architectures, the data supply chain, and network topology, readers will understand the critical components that ensure the functionality and reliability of Oracles in DeFi, providing context for the challenges and innovative solutions that define the landscape.

Omer Goldberg
Omer Goldberg
Cover Image for Next Generation of NFT Derivatives: Chaos Labs Partners with nftperp

Next Generation of NFT Derivatives: Chaos Labs Partners with nftperp

We are excited to announce the Chaos Labs and nftperp partnership, which aims to pioneer the risk management framework for ongoing parameter optimizations for nftperp’s Perpetual trading DEX.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Elected to Lead Risk for Arbitrum Research & Development Collective

Chaos Labs Elected to Lead Risk for Arbitrum Research & Development Collective

In a significant stride toward enhancing the Arbitrum ecosystem's resilience and efficiency, Chaos Labs has been elected to spearhead Risk Management for the Arbitrum Research and Development Collective.

Omer Goldberg
Omer Goldberg
Cover Image for dYdX Chain: Launch Incentives Season 3 Mid-Season Review

dYdX Chain: Launch Incentives Season 3 Mid-Season Review

Chaos Labs presents the mid-season 2 review of full trading on the dYdX Chain. All aspects of the exchange performance are covered with a focus on the impact of the launch incentive program.

Omer Goldberg
Omer Goldberg
Cover Image for Oracle Risk and Security Standards: An Introduction

Oracle Risk and Security Standards: An Introduction

Chaos Labs is open-sourcing our Oracle Risk and Security Standards Framework to improve industry-wide risk and security posture and reduce protocol attacks and failures. Our Oracle Framework is the inspiration for our Oracle Risk and Security Platform. It was developed as part of our work leading, assessing, and auditing Oracles for top DeFi protocols.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Partners with USDV for Genesis Risk Assessment and Strategic Growth

Chaos Labs Partners with USDV for Genesis Risk Assessment and Strategic Growth

Chaos Labs is thrilled to unveil our strategic partnership with Verified USD, a leap forward in our commitment to innovation within Tokenized Real World Asset (RWA) backed stablecoins.

Omer Goldberg
Omer Goldberg
Cover Image for dYdX Chain: Concluding Season 2 Launch Incentive Analysis

dYdX Chain: Concluding Season 2 Launch Incentive Analysis

Chaos Labs is pleased to provide a comprehensive review of the second trading season on the dYdX Chain. This analysis encompasses all facets of exchange performance, emphasizing the impact of the Launch Incentive Program.

Omer Goldberg
Omer Goldberg
Cover Image for USDC Liquidity Optimization Framework for OP Mainnet

USDC Liquidity Optimization Framework for OP Mainnet

Chaos Labs introduces a comprehensive analysis and strategic framework designed to enhance liquidity incentives and streamline the transition from bridged USDC.e to native USDC on the OP Mainnet, aiming for a seamless and efficient migration process.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Partners with Optimism Foundation

Chaos Labs Partners with Optimism Foundation

Chaos Labs is excited to collaborate with the Optimism Foundation to optimize liquidity incentives and facilitate the migration from bridged USDC.e to native USDC on OP Mainnet.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Partners with Avantis

Chaos Labs Partners with Avantis

Chaos Labs is excited to announce our new partnership with Avantis, marking a significant step forward in our journey toward innovating the world of on-chain trading. Over recent months, our collaboration with Avantis has focused on developing a genesis risk framework and the initial setting of parameters for their protocol.

Omer Goldberg
Omer Goldberg
Cover Image for dYdX Chain: Launch Incentives Season 2 Mid-Season Review

dYdX Chain: Launch Incentives Season 2 Mid-Season Review

Chaos Labs presents the mid-season 2 review of full trading on the dYdX Chain. All aspects of the exchange performance are covered with a focus on the impact of the launch incentive program.

Omer Goldberg
Omer Goldberg
Cover Image for Protocol Spotlight: Bluefin V3

Protocol Spotlight: Bluefin V3

Bluefin, the backbone of Sui's derivative exchange ecosystem, drives over 90% of on-chain trading volume. It has undergone a transformative journey from V1 to V2, fine-tuning its codebase for the Sui blockchain. In Q2 2024, Bluefin is set to unveil V3, a highly optimized iteration offering reduced feed, improved latency, and cross-margin trading accounts.

Omer Goldberg
Omer Goldberg
Cover Image for dYdX Chain Launch Incentives Program: Wash Trading Detection

dYdX Chain Launch Incentives Program: Wash Trading Detection

Chaos Labs has developed a sophisticated wash trading detection algorithm designed for the dYdX Chain Launch Incentives Program. To enhance the program's effectiveness and encourage genuine long-term activity, Chaos Labs has implemented a robust detection process that identifies and disqualifies traders generating inorganic flow from receiving incentives.

Omer Goldberg
Omer Goldberg
Cover Image for dYdX Chain: End of Season 1 Launch Incentive Analysis

dYdX Chain: End of Season 1 Launch Incentive Analysis

Chaos Labs presents the end-of-season 1 review of full trading on the dYdX Chain. All aspects of the exchange performance are covered with a focus on the impact of the launch incentive program.

Omer Goldberg
Omer Goldberg
Cover Image for The Imbalance Score: A Novel Metric for Ostium's RWA-Focused Perpetual DEXes

The Imbalance Score: A Novel Metric for Ostium's RWA-Focused Perpetual DEXes

Exploring risk mitigation levers and methodologies for weakly correlated assets, a key feature of the Ostium Perpetual DEX.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Partners with Bluefin

Chaos Labs Partners with Bluefin

Chaos Labs is thrilled to announce our partnership with Bluefin, a leader in decentralized derivatives trading. This collaboration marks a significant milestone in our mission to blend the robustness and security of blockchain technology with cutting-edge trading solutions. We aim to revolutionize how on-chain trading is experienced, ensuring a seamless and secure bridge to off-chain asset offerings.

Omer Goldberg
Omer Goldberg
Cover Image for Seamless Risk Monitoring and Alerting Platform

Seamless Risk Monitoring and Alerting Platform

Chaos Labs is excited to share our partnership with Seamless, centered around risk management and optimization, following their successful launch on Base.

Omer Goldberg
Omer Goldberg
Cover Image for sBNB Oracle Exploit Post Mortem

sBNB Oracle Exploit Post Mortem

Chaos Labs summarizes the snBNB oracle exploit affecting the Venus LST Isolated Pool. The post-mortem focuses on the event analysis and risk management efforts following the exploit.

Omer Goldberg
Omer Goldberg
Cover Image for dYdX Chain Analytics and Risk Monitoring Portal

dYdX Chain Analytics and Risk Monitoring Portal

Chaos Labs is thrilled to introduce the dYdX Chain Analytics and Risk Monitoring Portal, a significant development in our continued partnership with the dYdX community. This portal encompasses the emerging dYdX Chain, providing valuable insights and risk assessment capabilities. Additionally, it features a dynamic leaderboard that offers real-time tracking and visibility into traders' points, providing transparency and clarity regarding their positions in the Launch Incentives Program.

Omer Goldberg
Omer Goldberg
Cover Image for dYdX Chain: A Comprehensive Overview of the Launch Incentives Program

dYdX Chain: A Comprehensive Overview of the Launch Incentives Program

In collaboration with dYdX, Chaos Labs is excited to announce a $20 million liquidity incentives program to mark the launch of the new dYdX Chain. This initiative, a significant step towards enhancing user experience and liquidity, is tailored to transition users to the dYdX Chain seamlessly. It's not just a program; it's an invitation to be at the forefront of dYdX's vision, shaping the future of decentralized finance.

Omer Goldberg
Omer Goldberg
Cover Image for The Role of Oracle Security in the DeFi Derivatives Market With Chainlink and GMX

The Role of Oracle Security in the DeFi Derivatives Market With Chainlink and GMX

The DeFi derivatives market is rapidly evolving, thanks to low-cost and high-throughput blockchains like Arbitrum. Minimal gas fees and short time-to-finality make possible an optimized on-chain trading experience like the one GMX offers. This innovation sets the stage for what we anticipate to be a period of explosive growth in this sector.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Partners with Liquity Protocol

Chaos Labs Partners with Liquity Protocol

Liquity and Chaos Labs have announced a strategic collaboration centered around the development of Liquity v2, an upcoming, new Reserve-backed stablecoin protocol.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Partners with Ostium

Chaos Labs Partners with Ostium

Chaos Labs will work closely with Ostium Protocol to improve their mechanism design and create a risk modeling and monitoring system. The partnership will prioritize the system's robustness and secure functioning, helping bridge the gap between on-chain trading and off-chain asset offerings.

Omer Goldberg
Omer Goldberg
Cover Image for GMX V2 Risk Portal Product Launch

GMX V2 Risk Portal Product Launch

Chaos Labs is excited to launch the GMX V2 Synthetics Risk Hub, expanding our existing V1 GLP Risk Hub to provide complete coverage, including all protocol versions.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Partners with Ethena Labs for Mechanism Design, Economic Security and Risk Optimization

Chaos Labs Partners with Ethena Labs for Mechanism Design, Economic Security and Risk Optimization

Chaos Labs is partnering with Ethena Labs to fortify mechanism design and develop risk frameworks for the novel protocol. This collaboration is set to amplify the economic security and robustness of Ethena's innovative stablecoin, USDe.

Omer Goldberg
Omer Goldberg
Cover Image for crvUSD Risk Monitoring And Alerting Platform

crvUSD Risk Monitoring And Alerting Platform

Chaos Labs launches the crvUSD Risk Monitoring and Alerting Platform, providing thorough analytics and visibility and serving as a central hub for the crvUSD community to access a wealth of data and risk insights related to the protocol.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Risk Portal 2.0 Launch

Chaos Labs Risk Portal 2.0 Launch

Chaos Labs is proud to announce the official launch of the latest version of our Risk Hub.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Partners with Nexus Mutual for Economic Security and Risk Optimization

Chaos Labs Partners with Nexus Mutual for Economic Security and Risk Optimization

After an extensive RFP process, the Nexus Mutual Foundation selected Chaos Labs as an economic security and risk partner. This collaboration is set to fortify the future of the Ratcheting AMM (RAMM) design, a critical component of the Nexus Mutual protocol.

Omer Goldberg
Omer Goldberg
Cover Image for Radiant Risk Monitoring and Alerting Platform

Radiant Risk Monitoring and Alerting Platform

Chaos Labs launches the Radiant Risk Monitoring and Alerting Platform, providing thorough analytics and visibility and serving as a central hub for the Radiant community to access a wealth of data and risk insights related to the protocol.

Omer Goldberg
Omer Goldberg
Cover Image for Venus Risk Monitoring and Alerting Platform

Venus Risk Monitoring and Alerting Platform

Chaos Labs launches the Venus Risk Monitoring and Alerting Platform, providing thorough analytics and visibility and serving as a central hub for the Venus community to access a wealth of data and risk insights related to the protocol.

Omer Goldberg
Omer Goldberg
Cover Image for Compound Multi Chain Risk Monitoring Hub

Compound Multi Chain Risk Monitoring Hub

Chaos Labs has partnered with Compound via the Grants program, launching a state-of-the-art Compound Cross-Chain Analytics and Observability platform.

Omer Goldberg
Omer Goldberg
Cover Image for dYdX Risk Parameter Recommendation Portal

dYdX Risk Parameter Recommendation Portal

Chaos Labs and Considered.finance are excited to present our collaboration, the dYdX Risk Parameter Recommendation Portal 4. This dashboard provides real-time parameter recommendations informed by market liquidity and objective order book liquidity measures.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Partners with TapiocaDAO for Risk Management and Optimization

Chaos Labs Partners with TapiocaDAO for Risk Management and Optimization

Chaos Labs is thrilled to announce a strategic partnership with TapiocaDAO, centered around risk management and parameter optimization for the imminent launch of the omni-chain money market protocol and USDO.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Launches the Aave Asset Listing Portal to Streamline New Collateral Onboarding

Chaos Labs Launches the Aave Asset Listing Portal to Streamline New Collateral Onboarding

Chaos Labs has launched the Aave Asset Listing Portal, a tool that will streamline onboarding new collateral to the Aave protocol. The portal automates collecting and analyzing key market data around assets, enabling the community to make informed decisions and enhance risk management.

Omer Goldberg
Omer Goldberg
Cover Image for GMX GLP Risk Hub: A Public Derivative Risk Monitoring and Analytics Platform

GMX GLP Risk Hub: A Public Derivative Risk Monitoring and Analytics Platform

Chaos Labs is proud to partner with GMX, a leading DeFi perpetual platform, to launch the GMX GLP Public Risk Hub (Version 0), a cutting-edge platform designed to provide real-time user metrics, margin-at-risk analysis, alerting, and market simulations to assess the value at risk (VaR) in fluctuating markets.

Omer Goldberg
Omer Goldberg
Cover Image for Uniswap V3 TWAP: Assessing TWAP Market  Risk

Uniswap V3 TWAP: Assessing TWAP Market Risk

Assessing the likelihood and feasibility of manipulating Uniswap's V3 TWAP oracles, focusing on the worst-case scenario for low liquidity assets.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Partners with Compound for Cross-Chain Risk Analytics Grant

Chaos Labs Partners with Compound for Cross-Chain Risk Analytics Grant

Chaos Labs, a cloud-based risk management platform for DeFi applications, has been awarded a Compound Grant to build a Cross-Chain Risk and Analytics platform.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Risk Dashboard Launches Live Alerts for Real-Time Risk Management

Chaos Risk Dashboard Launches Live Alerts for Real-Time Risk Management

Chaos Risk Dashboard has rolled out new functionality that provides real-time alerts covering crucial indicators on the Aave v3 Risk Dashboard and BENQI Risk Dashboard.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs USDC Depeg - War Room Summary

Chaos Labs USDC Depeg - War Room Summary

Chaos Labs summarizes the USDC depeg event and risk management efforts following the collapse of SVB.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Launches the BENQI Parameter Recommendations Platform

Chaos Labs Launches the BENQI Parameter Recommendations Platform

Chaos Labs launches the BENQI Parameter Recommendations Platform to streamline risk parameter recommendations for the BENQI protocol.

Omer Goldberg
Omer Goldberg
Cover Image for Introducing the GHO Risk Monitoring Dashboard by Chaos Labs

Introducing the GHO Risk Monitoring Dashboard by Chaos Labs

Chaos Labs unveils a new version of the Aave v3 Collateral At Risk Dashboard monitoring the GHO deployment on the Goerli testnet in preparation for mainnet launch.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Raises $20M in Seed Funding to Automate On-Chain Risk Optimization

Chaos Labs Raises $20M in Seed Funding to Automate On-Chain Risk Optimization

Chaos Labs raises Seed funding led by Galaxy and Paypal Ventures to automate on-chain risk optimization.

Omer Goldberg
Omer Goldberg
Cover Image for AAVE v3 Collateral At Risk Dashboard Expands Deployments Support to Ethereum v3

AAVE v3 Collateral At Risk Dashboard Expands Deployments Support to Ethereum v3

Following the successful launch of the AAVE v3 Collateral At Risk Dashboard, we're proud to announce expanded support for Ethereum v3.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Unveils Parameter Recommendation Platform.

Chaos Labs Unveils Parameter Recommendation Platform.

After becoming full-time contributors to the Aave protocol in 2022, Chaos Labs has been working on all fronts to deliver tools that will increase the community’s understanding of Aave and its potential. We’re proud to publish V0 of the Chaos Labs parameter recommendation platform to the community!

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Selected by Uniswap Foundation for TWAP Oracle Research Grant

Chaos Labs Selected by Uniswap Foundation for TWAP Oracle Research Grant

Preceded by earlier V3 TWAP oracle research, the Uniswap Foundation announces a Chaos Labs grant.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs & Hathor Nodes launch platform to optimize Osmosis incentive distribution

Chaos Labs & Hathor Nodes launch platform to optimize Osmosis incentive distribution

Funded by the Osmosis Grants Program, the pair launches an open-sourced incentives model and community dashboards.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs receives a Uniswap Foundation grant for LP strategies for V3

Chaos Labs receives a Uniswap Foundation grant for LP strategies for V3

Chaos Labs has been awarded a grant from the Uniswap Foundation to test and simulate sophisticated LP strategies.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs helps navigate DeFi volatility with an expanded Aave V2 risk partnership

Chaos Labs helps navigate DeFi volatility with an expanded Aave V2 risk partnership

Chaos Labs announces further collaboration with Aave to include Aave V2 risk coverage.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Osmosis Liquidity Incentives Portal Update

Chaos Labs Osmosis Liquidity Incentives Portal Update

An update on the Osmosis Liquidity Incentives Portal collaboration with Hathor Nodes.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Launches Benqi Risk Dashboard

Chaos Labs Launches Benqi Risk Dashboard

Chaos Labs is launching the Benqi Risk Dashboard, utilizing real-time user metrics to understand the value at risk across volatile markets as well as yield earned and paid over time.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Asset Protection Tool

Chaos Labs Asset Protection Tool

Chaos is unveiling a new tool to measure price manipulation risk and protect against it. Introducing the Chaos Labs Asset Protection Tool

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Joins AAVE as Full-Time Contributor

Chaos Labs Joins AAVE as Full-Time Contributor

After a successful governance vote, Chaos Labs is joining Aave as a full-time contributor to focus on risk management and parameter recommendations for all Aave v3 markets.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Receives Osmosis Grant

Chaos Labs Receives Osmosis Grant

Chaos Labs has received a grant from the Osmosis Grants Program and will partner with Hathor Nodes on optimizing the Osmosis incentives program.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs <> Benqi veQI Calculator

Chaos Labs <> Benqi veQI Calculator

Chaos Labs, a cloud security platform for DeFi applications, announces the launch of the Benqi veQI calculator.

Omer Goldberg
Omer Goldberg
Cover Image for Maker Simulation Series: Auction Price Curve & Keeper Gas Strategies (Pt. 4)

Maker Simulation Series: Auction Price Curve & Keeper Gas Strategies (Pt. 4)

Chaos Labs, a cloud-based simulation platform for smart contract applications, has collaborated with Maker to model and simulate how Keepers with competing gas strategies impact the Auction Price Curve for liquidations.

Omer Goldberg
Omer Goldberg
Cover Image for Benqi veQI Economic Analysis

Benqi veQI Economic Analysis

Diving deep into Benqi's veQI tokenomics and utility.

Omer Goldberg
Omer Goldberg
Cover Image for Maker Simulation Series: Peg Stability Module (Pt. 3)

Maker Simulation Series: Peg Stability Module (Pt. 3)

Chaos Labs, a cloud-based simulation platform for smart contract applications, has collaborated with Maker to model PSM simulations.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs launches AAVE v3 Risk Bot

Chaos Labs launches AAVE v3 Risk Bot

The AAVE v3 Risk bot will provide monitoring, notifications and daily summaries for risk related activity across all v3 deployments.

Omer Goldberg
Omer Goldberg
Cover Image for Maker Simulation Series: Flapper Surplus Dai Auctions (Pt. 2)

Maker Simulation Series: Flapper Surplus Dai Auctions (Pt. 2)

Chaos Labs, a cloud-based simulation platform for smart contract applications, has collaborated with Maker to model and simulate Flapper Surplus DAI auctions.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Launches AAVE v3 Risk Application

Chaos Labs Launches AAVE v3 Risk Application

Chaos Labs, a cloud security platform for DeFi applications, has launched an AAVE v3 collateral at risk and real-time user metrics dashboard.

Omer Goldberg
Omer Goldberg
Cover Image for Maker Simulation Series: Flipper Black Thursday (Pt. 1)

Maker Simulation Series: Flipper Black Thursday (Pt. 1)

Chaos Labs, a cloud-based simulation platform for smart contract applications, has collaborated with Maker to model and simulate Flip Auctions, liquidations and auctions.

Omer Goldberg
Omer Goldberg
Cover Image for AAVE Simulation Series: stETH:ETH Depeg (Pt. 0)

AAVE Simulation Series: stETH:ETH Depeg (Pt. 0)

A simulation series focused on economic security for the AAVE protocol. Let's examine the effect of a stETH:ETH depeg.

Omer Goldberg
Omer Goldberg
Cover Image for Maker Simulation Series: Introduction (Pt. 0)

Maker Simulation Series: Introduction (Pt. 0)

Chaos Labs, a cloud-based simulation platform for smart contract applications, has collaborated with Maker to model and simulate liquidations and auction mechanisms.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Dives Deep Into AAVE v3 Data Validity

Chaos Labs Dives Deep Into AAVE v3 Data Validity

Chaos Labs, a cloud security platform for DeFi applications, has discovered

Ron Lev
Ron Lev
Cover Image for Chaos Labs Collaborates with Benqi For Liquid Staking Analytics

Chaos Labs Collaborates with Benqi For Liquid Staking Analytics

Chaos Labs, a cloud security platform for DeFi applications, announces a partnership with Benqi to support Liquid Staking on the Avalanche network.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Receives AAVE Grant

Chaos Labs Receives AAVE Grant

Chaos Labs, a cloud security platform for DeFi applications, has been awarded an AAVE Grant to build a collateral at risk and real-time user metrics dashboard.

Omer Goldberg
Omer Goldberg
Cover Image for Pushing Economic Security Boundaries with MakerDAO Pt. 2

Pushing Economic Security Boundaries with MakerDAO Pt. 2

Chaos Labs, a cloud security and testing platform for smart contract applications, has created a cloud platform for Maker to test their liquidation and auction mechanisms.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Open Source Uniswap v3 Hardhat Plugin

Chaos Labs Open Source Uniswap v3 Hardhat Plugin

Chaos Labs, a cloud security platform for DeFi applications, has open source a utility package for interfacing with Uniswap v3.

Omer Goldberg
Omer Goldberg
Cover Image for Uniswap v3 TWAP Oracle Deep Dive Pt. 2

Uniswap v3 TWAP Oracle Deep Dive Pt. 2

An in depth look at Uniswap v3 TWAP architecture and usage in development.

Omer Goldberg
Omer Goldberg
Cover Image for dYdX Maker Liquidity Rewards Distribution Report

dYdX Maker Liquidity Rewards Distribution Report

Chaos Labs releases the dYdX Market Maker Liquidity Rewards Distribution Report.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Receives Chainlink Grant to build Terra Oracle Infrastructure

Chaos Labs Receives Chainlink Grant to build Terra Oracle Infrastructure

Chaos Labs, a cloud security platform for DeFi applications, has been awarded a Chainlink Grant to build tooling and infrastructure for Terra Oracles.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs releases the dYdX Perpetual Funding Rate App

Chaos Labs releases the dYdX Perpetual Funding Rate App

Chaos Labs releases the dYdX Perpetual Funding Rate application for the dYdX ecosystem.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Open Sources Chainlink Price Feed NPM Module

Chaos Labs Open Sources Chainlink Price Feed NPM Module

Chaos Labs, a cloud security platform for DeFi applications, has open source a utility package for interfacing with Chainlink price feeds.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Open Sources dYdX Trading CLI

Chaos Labs Open Sources dYdX Trading CLI

Chaos Labs, a cloud security platform for DeFi applications, has open sourced a trading tool for the dYdX ecosystem.

Omer Goldberg
Omer Goldberg
Cover Image for Pushing Economic Security Boundaries with MakerDAO

Pushing Economic Security Boundaries with MakerDAO

Chaos Labs, a cloud security and testing platform for smart contract applications, has created a cloud platform for Maker to test their liquidation and auction mechanisms.

Omer Goldberg
Omer Goldberg
Cover Image for Uniswap v3 TWAP Oracle Tooling and Deep Dive Pt. 1

Uniswap v3 TWAP Oracle Tooling and Deep Dive Pt. 1

Chaos Labs, a cloud security platform for DeFi applications, has released open source tooling for developing with Uniswap v3 TWAP Oracles.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Receives dYdX Grant

Chaos Labs Receives dYdX Grant

Chaos Labs, a cloud security platform for DeFi applications, has been awarded a dYdX Grant to build analytics and tooling for the dYdX ecosystem.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Receives Uniswap Grant

Chaos Labs Receives Uniswap Grant

Chaos Labs, a cloud security platform for DeFi applications, has been awarded a Uniswap Grant to build tooling for Uniswap v3 TWAP Oracles.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Adds Chainlink Oracle Cloud Integrations

Chaos Labs Adds Chainlink Oracle Cloud Integrations

Chaos Labs receives grant to enhance Chainlink Oracle Cloud Testing Environment.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs joins Maker SES

Chaos Labs joins Maker SES

Chaos Labs, a cloud security and testing platform for smart contract applications, has recently joined the SES incubation program.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Receives Chainlink Grant

Chaos Labs Receives Chainlink Grant

Chaos Labs, a cloud security platform for DeFi applications, has been awarded a Chainlink Grant.

Omer Goldberg
Omer Goldberg
Cover Image for Chaos Labs Mission Statement

Chaos Labs Mission Statement

Chaos Labs is a cloud security and testing platform for smart contract applications. Mission statement coming soon 🎉 🥳

Omer Goldberg
Omer Goldberg