How to track DeFi Positions using MERLIN API?

Wallet or Custody Solution looking to retain your DeFi users in your ecosystem?
Fund Manager looking to monitor the profitability of your DeFi exposures?
Accounting SW Provider looking to track & financial report DeFi treasury activities?

Build your own DeFi exposure tracking with MERLIN API: most comprehensive DeFi Positions data with institutional-grade performance $ P&L analytics.

MERLIN API provides real-time data over a user’s active DeFi Positions, with the most extensive protocol coverage 1,500+ protocols across 25+ chains; not limited to EVM chains, supporting also Solana, major Cosmos chains and others.
For major DeFi protocols, covering 80% of DeFi TVL, the most in-depth P&L analytics are one endpoint call away for both active Positions, but also past closed Positions for reporting purposes.

1. Let’s get started: api.mymerlin.io

Sign up to start your Free Trial

Your account will be topped up with 4000 free units, and your API Key is created!
Check for the API Doc and look for the DeFi Positions API endpoints, start with the most complete one getUserDeFiHistoryWithPnl.

2. Retrieve DeFi Position data

Pick your test tool and make the first calls

Using the Postman app in our example. Create a new request, the endpoint URL:
https://merlin-api-v1.cf/api/merlin/public/userDeFiPositionsWithPnl/all/userAddress
Fill in the user wallet address and configure the Authorization API Key.

3. Check out the DeFi Position data

And integrate it to your usecase

Explore the user’s portfolio data across all active & past DeFi Positions, which are structured per Protocol. Explore each Position’s supply, debt, reward and associated lpToken balances as well as the performance $ Yield and $ P&L. JsonGrid explorer used in this example.

Also download a sample response here.
You can now begin building your usecase around DeFi using the MERLIN data. To cater various needs and optimize the cost, several DeFi Positions endpoints are proposed:

  • With or without P&L historical analytics
  • With data filtering: one protocol, one chain, several chains (up to 10), all chains
  • With time traveling option: snapshot the user’s DeFi Positions status at a certain date point back in time – especially useful for reporting purposes

4. Questions?

Check your API Panel or contact us

MERLIN API Doc contains the exhaustive list of all available endpoints and their descriptions.
MERLIN API Panel provides all necessary information to manage your API usage: endpoints price, your unit balance, your unit consumption history, ask for additional trial units, online purchase.
For any other questions or comments, feel free to contact us!