Liquidity is a fundamental concept in DeFi, often compared to traditional financial markets. Unlike traditional markets, which use order books to display available liquidity at different prices, most DeFi protocols do not provide this transparency, except for Uniswap V3. This lack of an order book makes it difficult to understand the price of an asset since the liquidity available at specific prices is not directly observable.Amberdata liquidity endpoints provide the current liquidity price for both assets in a trading pair, with options to retrieve the latest data or the full historical record from the pool’s inception. Detailed information about each pool is also provided, including the pool address, pair name, base and quote token addresses, exchange ID, and other relevant metadata.Due to Uniswap V3’s unique liquidity model, a dedicated endpoint is available to capture its distinct liquidity distribution features, described below.
Liquidity endpoints enable the determination of the implied price of one asset relative to its paired asset. For instance, in the WBTC_WETH pool on Uniswap V2, a liquidity price of approximately 13.73 for WBTC and 0.072 for WETH indicates that 1 WBTC equals roughly 13.73 WETH, and 1 WETH equals approximately 0.072 WBTC.Historical prices can be analyzed using the historical endpoint, which provides time series data from the pool’s inception.LP Tokens: Liquidity providers receive LP tokens representing fractional ownership of the pool. Understanding the USD value of these tokens—and consequently the value of a liquidity position—can be challenging. The Snapshot endpoint calculates the current USD value of LP tokens, allowing straightforward valuation of liquidity positions by multiplying the LP token price by the token balance.Uniswap V3 Liquidity Distribution: Uniswap V3 allows liquidity providers to concentrate liquidity within specific price ranges, unlike V2, where liquidity is distributed uniformly across the entire price curve. This feature effectively creates a “pseudo order book,” which is unique in DeFi.The Uniswap V3 liquidity distribution endpoint enables querying of pools by token (0 or 1) to view liquidity allocated across different price ticks. The “Active Tick,” representing the current market price range at the most recent block, is also provided. This information supports liquidity providers in optimizing positions and gives traders deeper insight into pool liquidity dynamics.
DeFi Liquidity endpoints are available via REST API for information, latest, historical (time series), Snapshot, and Uniswap V3 data. Comprehensive event data is available from the genesis block onward, ensuring complete historical datasets for supported protocols.
How frequently do you report changes to the liquidity endpoints?
All DeFi endpoints are block-based, with any event or change in a pool reflected on each new block
How is the LP Token Price Calculated?
The LP token price in the Snapshot endpoint is calculated as a weighted average of the underlying tokens in the pool, adjusted to exclude any spam tokens.