UniswapV3 Exchange Trade Data

UniswapV3 API Logo

UniswapV3 API

Information
Network
Ethereum
Source type
DEX
Volume 24h
$ 1,122,780,235.425
Pairs available
29337
Trades 24h
57,009
Exchange Information

What is UniswapV3?

UniswapV3 is a decentralized cryptocurrency exchange built on the Ethereum blockchain. It allows users to trade digital assets directly from their wallets. Launched in 2021, UniswapV3 aims to improve upon the previous versions by introducing concentrated liquidity and reducing slippage. It was founded by Hayden Adams and is operated by Uniswap Labs. The name "Uniswap" comes from the concept of universal swapping of tokens.

What are the benefits of using UniswapV3?

UniswapV3 offers several benefits compared to its direct competitors in the decentralized exchange (DEX) space.

1. Concentrated Liquidity: Unlike other DEXs, UniswapV3 allows liquidity providers to concentrate their liquidity within a specific price range. This means that users can provide liquidity to a specific price range where they expect trading activity to occur, rather than across the entire price spectrum. This improves capital efficiency and reduces impermanent loss.

2. Optimized Fee Structure: UniswapV3 introduced a dynamic fee structure that allows liquidity providers to earn higher fees in volatile markets and lower fees in stable markets. This helps maintain liquidity during periods of high volatility and ensures that fees are fair and competitive.

3. Improved Price Execution: UniswapV3 utilizes an innovative price oracle mechanism known as the "oracle price model." This improves the accuracy of price quotes by reducing the impact of large trades on the market price, making it more difficult for traders to manipulate prices.

Compared to its direct competitors, such as SushiSwap and Curve Finance, UniswapV3's benefits include greater capital efficiency, a more flexible fee structure, and improved price execution. SushiSwap, for example, lacks the concentrated liquidity feature, while Curve Finance focuses primarily on stablecoin trading pairs and does not offer the same level of price execution flexibility.

Overall, UniswapV3 provides users with enhanced control over their liquidity provision, better fee optimization, and improved price execution, making it a compelling choice for decentralized trading.

How does UniswapV3 work?

UniswapV3 is an automated market maker (AMM) protocol built on the Ethereum blockchain. It leverages smart contracts to enable the swapping of tokens directly on the blockchain, without relying on centralized intermediaries.

At the core of UniswapV3 is a liquidity pool system, where users can provide liquidity by depositing tokens into pools. These pools consist of pairs of tokens, such as ETH/USDT or DAI/USDC. Liquidity providers earn fees from trades made in these pools, proportionally to their share of the liquidity.

The protocol utilizes a unique feature called "concentrated liquidity." Unlike previous versions, UniswapV3 allows liquidity providers to choose the range within which their deposited tokens can be traded. This introduces different price ranges (known as "price ranges") within a single pool, facilitating more efficient trading and reducing impermanent loss.

The functioning of UniswapV3 relies on two main components: the liquidity provision and the swapping mechanism. Liquidity providers deposit tokens into pools and receive pool tokens in return, which represent their share of the pool's liquidity. These pool tokens can be redeemed at any time for the respective underlying tokens plus accrued fees.

When a user wants to swap tokens on UniswapV3, the protocol searches for the most efficient route across available pools to fulfill the trade. It calculates the conversion rate based on the available liquidity and executes the transaction using smart contracts.

UniswapV3 is a prominent example of how AMMs function and demonstrates the potential of decentralized trading systems on blockchain networks.

How does DIA fetch UniswapV3 trade data?

DIA takes a comprehensive approach to fetching trade data from DeFi and NFT exchanges. The process varies depending on the type of exchange being referred to.

For centralized exchanges like Coinbase, Kraken, and Binance, DIA uses scrapers to collect trade data directly from the exchange databases. This is done using Rest APIs or WebSocket APIs, with data collection frequencies ranging from 1 to 7 seconds, depending on the exchange. By fetching data as close to the source as possible, DIA ensures high precision.

For decentralized exchanges such as Uniswap, curve.finance, and PancakeSwap, DIA subscribes to swap events in liquidity pools on various blockchains. This allows DIA to retrieve trading data directly from the blockchain itself, ensuring enhanced data accuracy. By leveraging the blockchain oracle, DIA is able to provide verified data from outside the blockchain to smart contracts.

When it comes to NFT marketplaces, DIA captures live trading data from integrated marketplaces' smart contracts. The retrieval period ranges from 20 seconds to 1 minute, covering all NFT transactions in real-time. DIA does not rely on unreliable bids and offer data, ensuring data precision from the broader NFT market. Notable NFT integrated exchange sources include Blur, X2Y2, OpenSea, and TofuNFT.

Overall, DIA's comprehensive data management strategy, with its use of scrapers, blockchain oracle, and integration with NFT marketplaces, enables them to provide highly accurate and customizable price feeds to users.

How build oracles with UniswapV3 data?

DIA follows a process to compute trade data from UniswapV3 in order to build price feed oracles for both DeFi and NFT exchanges.

For DeFi exchanges, DIA first cleans the data and removes outliers to avoid using divergent trade prices. This is important to prevent irregularities caused by market manipulation or errors. The cleaning process involves the application of an Interquartile Range (IR) filter, which excludes data points outside an acceptable range relative to the interquartile range. Only trades falling within the middle quartiles move forward for further processing.

Once the data is cleaned, DIA applies price determination methodologies to obtain a single price value for each asset. One example of a methodology used is the Volume Weighted Average Price (VWAP), which takes into account the different volumes of trades. Trades are collected and weighted by volume, and the weighted average price is calculated.

For NFT exchanges, the process is different. DIA determines the floor price of an NFT collection by processing on-chain trade data in two steps. Firstly, the data is passed through cleansing filters to exclude outliers and manipulation techniques. Then, a pricing methodology is applied to determine the final price point.

The simplest methodology for NFT collections is the Floor Price, which provides the lowest sale price recorded on the blockchain within a given time window. However, this methodology is susceptible to manipulation. To address this, DIA offers advanced methodologies such as Moving Average of Floor Price, which calculates the moving average of the collection's floor price.

To ensure more realistic and reliable NFT floor prices, DIA also applies outlier detection filters, such as the interquartile range filter, to filter out malicious behavior like wash trading.

In summary, DIA utilizes a multi-step process involving data cleaning, outlier removal, and specific price determination methodologies to compute trade data from UniswapV3 and build price feed oracles for both DeFi and NFT exchanges.

How does DIA source price oracle data?

Instead of distributing pre-calculated data feeds, DIA covers the whole data journey from individual trade collection, and computation to the last mile of the feed delivery.

Granular trade data collection
DIA retrieves token and NFT tradign data from 100+ exchanges. This enables DIA to build the most precise and customizable price feed oracles.
Instant, direct sourcing
DIA utilizes RPCs and WebSockets to subscribe to swap events and gather trading data from both DEX liquidity pools and CEX databases, allowing for real-time data collection.
Learn more about data sourcing