Impermanent Loss & DEX Returns

Analyze a wallet's impermanent loss and returns from providing liquidity in a DEX.

📘

Not specifying startDate and endDate

If the startDate and endDate query parameters are not provided, the API will return the data from the previous 93 days.

🚧

Time Range Limit

There is no maximum limit for the difference between startDate and endDate. The endpoint will automatically paginate across the entire specified time range.

📘

Uniswap v3 NFT Positions

In Uniswap v3, liquidity positions are tracked using NFTs. The positionId values seen in the API response are referring to those NFT Ids.

Potential Use-Cases

You can use the aggregate data to analyze yield and investment performance of the wallet.

Response Data

Fields and paths are relative to the top-level payload field i.e. metadata.next is equivalent to payload.metadata.next.

FieldTypeDescription
metadata.nextstringPagination
data.metrics[index].timestampnumber | stringThe timestamp indicating the end of the day.
data.metrics[index].cumulativeFeesClaimedUSDnumberThe US dollar value of the fees that the wallet has claimed since the beginning of time.
data.metrics[index].cumulativeFeesUnclaimedUSDnumberThe US dollar value of the fees that the wallet has accumulated and remain unclaimed since the beginning of time or the last time the wallet collected fees.

When fees are claimed, the value of cumulativeFeesClaimedUSD is updated and cumulativeFeesUnclaimedUSD is decremented.
data.metrics[index].impermanentLossRationumberImpermanent loss of this wallet across its open positions at the end of the day.
data.metrics[index].positions[index].positionIdstringThe unique id of the liquidity position.
data.metrics[index].positions[index].positionOpenboolean A boolean indicating if the position is still open on this day.
data.metrics[index].byToken[index].tokenAddressstringThe smart contract address of the token for which fees are claimed or unclaimed.
data.metrics[index].byToken[index].tokenFeesClaimedAmountNativestringThe amount of this token claimed as fees during this day measured in native amounts.
data.metrics[index].byToken[index].tokenFeesClaimedAmountstringThe amount of this token claimed as fees during this day measured in decimal-adjusted amounts.
data.metrics[index].byToken[index].tokenFeesUnclaimedAmountNativestringThe cumulative amount of this token that remains unclaimed as fees since the beginning of time and up to the end of this day, as measured in native amounts.
data.metrics[index].byToken[index].tokenFeesUnclaimedAmountstringThe cumulative amount of this token that remains unclaimed as fees since the beginning of time and up to the end of this day, as measured in decimal-adjusted amounts.
data.metrics[index].byToken[index].tokenLiquidityAmountNativestringThe liquidity of this token at the end of this day.
data.metrics[index].byToken[index].tokenLiquidityAmountstringThe liquidity of this token at the end of this day as measured in decimal-adjusted amounts.
data.metrics[index].byToken[index].tokenPriceUSDnumberThe US dollar value of this token at the end of this day.

Understanding Impermanent Loss

Impermanent loss is the difference in the value of assets that an user experiences from having the aforementioned assets locked as liquidity versus having simply held the assets. The difference occurs because the swap (trade) price of the assets in the liquidity pool changes over time. If the swap price of the assets returns to the original price at the time when the wallet provided liquidity, then the wallet will have experienced no impermanent loss.

Language
Authorization
Header
Click Try It! to start a request and see the response here!