The Match Between Aave and Merlin by VALK

Build On Merlin
4 min readJul 7, 2022


Merlin by VALK | Smart DeFi Portfolio Tracker


With the vast array of DeFi protocols, be it borrowing/lending apps, decentralised exchanges (DEXs), liquid staking platforms and more, it is easy to get lost among them. Understanding your risk exposure, which trading strategy performed best and what your total PNL is in your main reporting currency can be a daunting task. Merlin helps by displaying all positions on major protocols in its interface, while performing necessary analysis and calculations related to each. One such protocol integrated within Merlin is Aave.

Intro to Aave

Aave is a blue-chip borrowing/lending protocol, created in the DeFi 1.0 era with its root at the end of the previous 2017/2018 cycle. It has proved itself as one of the most secure and trusted protocols out there, driving innovation in the crypto sector and continuing to outperform most other DeFi platforms due to its simplicity, functionality and resilience to even the most brutal of storms.

The accessibility and usability of the platform, combined with the open-source nature of its smart contracts and code have allowed it to be assessed and critiqued openly on its forums, and across the ecosystem, leveraging another strength of DeFi.

Users on Aave are able to borrow/lend digital assets, without the need for a middleman, with the interest rates determined by an algorithm focusing on supply, demand and liquidity within its multitude of pools. Despite the recent downturn in the market, Aave has continued to function and dominates the market, commanding over $5B in total value locked (TVL), second only to MakerDAO.

However, despite its operational excellence, it can still be difficult to understand which of an investor’s positions are successful or not in terms of yield accrued and PNL accrued, and how they are measured in terms of ROI in USD or %. Enter Merlin, VALK’s DeFi portfolio tracker that provides institutional-grade reporting, analytics and calculations.

Intro to Merlin

Merlin by VALK focuses on in-depth analysis related to positions on major DeFi protocols such as Aave, Compound, Lido, Uniswap (and plenty more to come — contact us for the full roadmap and API access).

By extracting all transactional information from an investor’s wallet and retrieving each position deployed, Merlin calculates yield generated, current price of the asset vs entry price and transaction fees in order to show the position balance in terms of PNL as well as the aggregate portfolio balance.

This holistic view of positions is displayed on Merlin’s dashboard, which shows net worth, overall PNL, total debts and fees, asset composition and more.

How Merlin can help Aave users

Let’s dive in and view Merlin analytics on Aave positions. Merlin is able to extract each individual position and asset balance from the wallet, giving insights into the number of transactions per asset, their relative value (and 24H change), holdings in USD, and yield earned (which is negative if the asset is borrowed).

Notice how the PNL can be negative even when an asset is lent for positive yield — this is due to the price of the yielding asset falling since the initial deposit. Platforms such as Aave only show the net worth of the user’s portfolio or a breakdown per currency, and the value that is displayed is equivalent to their aToken. However, when the investment is made into a non-stablecoin, 2 variables come into play: the yield received in the aToken that is invested and the assets price compared to USD.

Merlin is able to spot both in order to calculate PNL.

Going deeper, Merlin shows the investor extended analysis of each transaction, filtered by protocol or by the asset in question. On Merlin’s transactions tab, it is possible to view each position by type (deposit, withdraw, transfer) as well as the amount, yield & PNL, date, transaction fee and any linked transaction.

This tracking and analysis is displayed all in one platform, and Merlin allows Aave investors to elevate their game whilst being able to monitor their portfolio in a safe and comprehensible manner.

Merlin’s data analytics engine doesn’t just track aggregate DeFi transactional activity, but provides institutional-grade wallet reporting for individual portfolios, including net worth, PNL & total fee calculations.

You can access the app for free on our website:

Follow us on Socials:



Build On Merlin

Merlin is a Decentralized Smart Data Network, allowing you to build smarter applications.