Position Analytics End-points

This section provides all the needed information about how to request the Ethereum Uniswap v2 & v3 Daily Analytics

getDailyAnalyticsByPositionUniswap

Get a Position's daily evolution analytics. Applies for Uniswap V2.

GET https://api-v1.mymerlin.io/api/merlin/public/lpTokenAnalyticsByDay

For all Uniswap V2 Positions (active/open or past/closed), this endpoint returns a list of daily analytics reflecting the Position's evolution in time. Daily analytics include: daily & cumulative Fees (Yield), Tokens & LP Token holdings and price, daily & cumulative Transaction Fees. The daily analytics cover the Position's entire life duration.

Query Parameters

{
"data": [
        {
            "timestamp": 1611014400,
            "dailyFeesToken0": 272.978281,
            "dailyFeesToken1": -0.13182100510743472,
            "dailyFeesToken0USD": 246.6287991412291,
            "dailyFeesToken1USD": 374.14504174270724,
            "dailyFeesUSD": 620.7738408839364,
            "dailyTxFees": 0.006676634475,
            "dailyTxFeesUSD": 8.34,
            "dailyLpTokenMinted": 0.00125525193502748,
            "token0UsdRate": 0.9995710762032741,
            "token1UsdRate": 1256.583352760434,
            "cumulativeFeesToken0": 272.978281,
            "cumulativeFeesToken1": -0.13182100510743472,
            "cumulativeFeesToken0USD": 272.86119411928973,
            "cumulativeFeesToken1USD": -165.64408056215063,
            "cumulativeFeesUSD": 107.2171135571391,
            "cumulativeTxFees": 0.006676634475,
            "cumulativeTxFeesUSD": 8.34,
            "lpPrice": 9.602775704361512E7,
            "lpTokenAmount": 0.00125525193502748,
            "token0Amount": 60265.756456,
            "token1Amount": 47.98656772257682,
            "lpTokenValueUSD": 120539.0278453466,
            "userPoolShare": 4.478392310233844E-4,
            "poolTvlUSD": 2.6915691948178726E8,
            "events": {
                "11675695": {
                    "timestamp": 1610925832,
                    "blockNumber": 11675695,
                    "eventType": "UniswapV2Mint",
                    "balances": {
                        "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": -59992778175,
                        "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2": -48118388727684259636,
                        "0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc": 1255251935027480
                    },
                    "isOpposite": false,
                    "transaction": "0xa32e6bc0c063e9eb8bc95029e8652b9ce0903dced32590acaba53e8e32b5833e",
                    "txInfo": {
                        "txFee": {
                            "fee": 6676634475000000,
                            "feeUSD": 8.34
                        },
                        "block": 11675695
                    }
                }
            }
        },...
    ],
    "metadata": [
        {
            "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
            "symbol": "USDC",
            "name": "USD Coin",
            "decimals": 6,
            "logo": null
        },
        {
            "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
            "symbol": "WETH",
            "name": "Wrapped Ether",
            "decimals": 18,
            "logo": null
        }
    ]
}

curl -X GET --header 'Accept: application/json' 
'https://api-v1.mymerlin.io/api/merlin/public/lpTokenAnalyticsByDay?position={positionId}' \
--header 'Authorization: {Api Secret Key}'

getSnapshotAnalyticsAllPositionsUniswap

Get an analytics snapshot of the user's Uniswap Positions. Applies for Uniswap V2 & V3.

GET https://api-v1.mymerlin.io/api/merlin/public/uniswapLpTokenAnalytics/{address}

For all user's Uniswap Positions (active/open or past/closed), this endpoint returns a list with each Position's analytics. The analytics include: daily, cumulative and collected Fees (Yield), daily and cumulative Transaction Fees, Price Fluctuation, P&L to date, realized P&L, Impermanent Loss.

Time-travelling possible: input the 'timestamp' parameter for a snapshot back in time.

Path Parameters

Query Parameters

{
    "blockNumber": 0,
    "timestamp": 0,
    "lpTokensData": {
        "key (address or NFT id)": {
            "lpTokenAddress": "string",
            "nftId": "BigInteger" or null,
            "underlyingTokens": [
                "string",
                "string"
            ],
            "lpTokensMinted": "BigInteger" or null,
            "lpPriceUsd": "Double" or null,
            "dailyFeesUsd": "Double" or null,
            "cumulativeFeesUsd": "Double" or null,
            "collectedFeesUsd": "Double" or null,
            "dailyTxFeesUsd": "Double" or null,
            "cumulativeTxFeesUsd": "Double" or null,
            "currencyDiffUsd": "Double" or null,
            "pnLUsdPnLToDate": "Double" or null,
            "pnLUsdRealized": "Double" or null,
            "impermanentLoss": "Double or null"
        }...,
    }
}
curl -X GET --header 'Accept: application/json' 
'https://api-v1.mymerlin.io/api/merlin/public/uniswapLpTokenAnalytics/{address}' \
--header 'Authorization: {Api Secret Key}'

Last updated