Uniswap V3 Oracle

Compute TWAP data from Uniswap V3 on-chain oracle observations.

Updated Jan 28, 2026
One-click install
npx skills add https://github.com/cyotee/uniswap-V3-skill --skill uniswap-v3-oracle
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Uniswap V3 Oracle
Source: https://github.com/cyotee/uniswap-V3-skill/tree/main/.opencode/skills/uniswap-v3-oracle
Command: npx skills add https://github.com/cyotee/uniswap-V3-skill --skill uniswap-v3-oracle

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Uniswap V3 pools expose an on-chain oracle that stores price observations, enabling time-weighted average price (TWAP) calculations without external data sources.

Core Features & Use Cases

  • On-chain TWAP calculation: compute TWAPs from stored observations without off-chain data.
  • Observation management: interact with observe and observeSingle to read and interpolate values.
  • Use Case: integrate TWAP-derived prices into liquidity strategies, pricing models, and analytics across multiple pools and timeframes.

Quick Start

Run a simple check by querying the last TWAP over a chosen window using the OracleLibrary via a smart contract.

Frequently Asked Questions about Uniswap V3 Oracle

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I calculate time-weighted average price (TWAP) from Uniswap V3 on-chain data?

TWAP calculation uses Uniswap V3's on-chain oracle, which stores price observations. Call the OracleLibrary to read observations over your chosen timeframe and compute the weighted average without external data sources.

What's the difference between observe and observeSingle in Uniswap V3 oracles?

observe() retrieves multiple observations across a time window for TWAP computation, while observeSingle() fetches a single interpolated price at a specific timestamp. Use observe() for analytics and observeSingle() for point-in-time pricing.

Can I use Uniswap V3 oracle data for automated trading and liquidity strategies?

Yes. The on-chain oracle supports TWAP-derived prices for liquidity strategies, pricing models, and automated trading across multiple pools and timeframes without relying on external price feeds.

What is cardinality in Uniswap V3 oracles and why does it matter?

Cardinality is the maximum number of observations a pool can store. Managing cardinality determines how far back you can query historical prices; higher cardinality enables longer TWAP windows.

Do I need to manage observation data before querying TWAP values?

Yes. Cardinality management ensures sufficient historical observations exist in the pool. Insufficient cardinality limits your TWAP window length, so verify pool observation history before querying.