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.

Field

Type

Description

metadata.next

string

Pagination

data.metrics[index].timestamp

number | string

The timestamp indicating the end of the day.

data.metrics[index].cumulativeFeesClaimedUSD

number

The US dollar value of the fees that the wallet has claimed since the beginning of time.

data.metrics[index].cumulativeFeesUnclaimedUSD

number

The 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 ofcumulativeFeesClaimedUSD is updated and cumulativeFeesUnclaimedUSD is decremented.

data.metrics[index].impermanentLossRatio

number

Impermanent loss of this wallet across its open positions at the end of the day.

data.metrics[index].positions[index].positionId

string

The unique id of the liquidity position.

data.metrics[index].positions[index].positionOpen

boolean

A boolean indicating if the position is still open on this day.

data.metrics[index].byToken[index].tokenAddress

string

The smart contract address of the token for which fees are claimed or unclaimed.

data.metrics[index].byToken[index].tokenFeesClaimedAmountNative

string

The amount of this token claimed as fees during this day measured in native amounts.

data.metrics[index].byToken[index].tokenFeesClaimedAmount

string

The amount of this token claimed as fees during this day measured in decimal-adjusted amounts.

data.metrics[index].byToken[index].tokenFeesUnclaimedAmountNative

string

The 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].tokenFeesUnclaimedAmount

string

The 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].tokenLiquidityAmountNative

string

The liquidity of this token at the end of this day.

data.metrics[index].byToken[index].tokenLiquidityAmount

string

The liquidity of this token at the end of this day as measured in decimal-adjusted amounts.

data.metrics[index].byToken[index].tokenPriceUSD

number

The 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
Credentials
Header
Click Try It! to start a request and see the response here!