Definition
Liquidity Pools are fundamental components driving DeFi protocols. They serve multiple purposes, including adding liquidity to earn fees, removing liquidity to claim accrued fees, and swapping one asset for another (e.g., WBTC for WETH). This section also covers impermanent loss endpoints, which are detailed further in the Portfolio and Returns sections. In total, there are seven endpoints: three related to liquidity pools and four related to impermanent loss.Details
Liquidity Pool Endpoints Two primary perspectives are provided for liquidity pools: the pool point of view and the provider point of view.- Pool Point of View: This presents a comprehensive view of every liquidity provider within a specific pool. For example, the DAI_WETH pool on Uniswap V2 consists of thousands of liquidity providers. The data includes each provider’s address, percentage ownership of the pool, the number of LP tokens held (in WEI), and the timestamp of their most recent liquidity event. This perspective is useful for assessing the size and liquidity of a pool.
- Provider Point of View: This shows every pool in which a given address has provided liquidity. The data includes percentage ownership in each pool, the number of LP tokens owned (in WEI), and the date of the last liquidity event, mirroring the information available from the pool perspective.
Provider A adds $100 worth of assets to the DAI_WETH Uniswap V2 pool on day 1. On day 2, Provider A removes $50 worth of assets and later adds that same $50 back into the pool. Although the end-of-day pool holdings appear unchanged, the fees and IL calculations would be incorrect if based solely on daily snapshots. Event-level tracking allows precise calculation of IL in such scenarios. Four impermanent loss endpoints are available:
- Provider Return Since Inception: Shows IL for a liquidity provider from their initial liquidity event up to a specified date, providing a macro view of the position.
- Provider Historical Return: Offers up to 731 days of IL data for a liquidity provider, giving a micro, day-by-day view.
- Pool Total Return: Aggregates IL and returns for all liquidity providers in a pool since its inception, including fees earned (token and USD value), fee claim status, IL, and overall return.
- Impermanent Loss & DEX Returns: The newest endpoint, currently supporting only Uniswap V3, calculates daily changes in IL and displays results as a ratio (rather than USD) to avoid price anomaly distortions. Protocol coverage expansion is planned.
API Endpoints
/market/defi/liquidity-positions/pairs/{pair}/latest /market/defi/liquidity-positions/providers/{address}/latest /market/defi/liquidity/providers/{providerAddress}/events //market/defi/liquidity/providers/return/{liquidityPoolAddress} /market/defi/liquidity/providers/daily-return/{liquidityPoolAddress} /market/defi/liquidity/pool/daily-return/{address}Availability
DeFi Liquidity Pool endpoints provide data from both the pool and provider perspectives, as well as detailed provider event histories. Impermanent loss endpoints support both macro (since inception) and micro (daily, up to 731 days) views, pool-level aggregation, and the latest Uniswap V3-specific returns.Frequently Asked Questions
What is the difference between a mint, burn, and swap in the Events endpoint?- Mint: Represents the addition of liquidity to a pool (e.g., adding assets to the DAI_WETH pool on Uniswap V2).
- Burn: Represents the removal of liquidity from a pool.
- Swap: Represents the exchange of one token for another within a pool (e.g., swapping DAI for WETH or vice versa).