Wallets and tools · Explainer
Zerion DeFi SDK: What It Does and How Developers Use It
The Zerion DeFi SDK is an open-source library that helps developers read a wallet's DeFi positions without writing a separate integration for every protocol. This guide explains what it does, how it differs from Zerion's hosted API, and what to check before you build on it.
By the DappsAtlas editorial team · Updated

What is the Zerion DeFi SDK?
The Zerion DeFi SDK is an open-source library published by Zerion. Its purpose is to help developers read a user's decentralized finance positions, such as lending deposits, borrowed amounts, liquidity pool shares and staked balances, and return them in a consistent format that an app can display or act on.
The main problem it targets is fragmentation. Every DeFi protocol stores positions in its own way, with its own contract functions and data layouts. A developer who wants to show a complete picture of a wallet would otherwise have to learn and maintain separate code for each lending market, exchange pool and vault. The SDK packages that work so an app can ask a common question, such as what does this address hold across supported protocols, and receive a normalised answer.
It is a developer tool, not a consumer app. End users do not install it. They see its output inside products that other teams build, such as portfolio trackers, wallet interfaces and treasury dashboards.
Before you plan around it, keep two points in mind. First, the library is only useful for the protocols and chains it supports, and that coverage changes over time. Second, the data it returns reflects onchain state at the moment it is read, so your app needs to decide how often to refresh and how to show stale results.
How does the Zerion DeFi SDK differ from the Zerion API?
Zerion also offers a hosted API. The two are often confused because both are associated with the same company and both concern wallet and portfolio data, but they solve different engineering problems.
The SDK is code you run inside your own project. You import it, configure the blockchain connections you need, and call its functions. Your app keeps control of the infrastructure, and the logic that reads positions executes in your environment.
The hosted API is a service you call over HTTP. You send requests with an API key and receive data that the provider has already collected and processed. You do not manage the protocol-specific reading logic yourself.
The practical difference shows up in three areas:
- Control: the SDK lets you decide which nodes, chains and refresh rules to use. A hosted API limits those choices to what the service offers.
- Dependencies: the SDK adds a library to your build and requires updates when protocols change. A hosted API moves that maintenance to the provider.
- Operating cost: the SDK requires RPC access and compute. A hosted API typically bills by usage under its own terms.
The GitHub results also list a TypeScript SDK for the Zerion API that a third party appears to maintain. Check the publisher and the license before using it, and do not assume it carries the same support or guarantees as an official package.
Which developer problems does the SDK solve?
Developers usually reach for this kind of library when they face one of three tasks. The first is building a portfolio view. A user connects a wallet and expects to see deposits, debts and pool shares in one place, not spread across ten protocol interfaces. Reading each protocol directly is slow to build and hard to keep correct.
The second task is risk monitoring. A lending position can become unsafe when collateral prices move, so an app that tracks health factors needs reliable position data. The SDK gives a starting point for that logic, although the alert thresholds and the price sources remain your responsibility.
The third task is internal tooling. Treasury teams, DAOs and funds often need to see what their multisig or operating wallets hold across chains. A position reader can feed a report or an internal dashboard.
In each case the SDK reduces the amount of protocol-specific code you write. It does not remove the need to understand the protocols. Your team still has to decide what a position means for your users, how to present risk, and when to warn people that data may be incomplete.
How does the adapter model read DeFi positions?
The SDK's design centres on adapters. An adapter is a module that knows how to read positions from one protocol or one family of similar contracts. The core library asks each adapter for the positions it can find for an address, then combines the results into one structure.
This structure has a few practical consequences. If a protocol is not covered by an adapter, its positions will not appear, even if the wallet holds them. If a protocol upgrades its contracts, the matching adapter may need an update before the data is correct again. Adapters can also differ in depth, so one might report simple balances while another reports health factors and reward accruals.
For developers, the useful habit is to inspect the adapter list and test each adapter against a wallet whose positions you already know. Write a small set of fixtures, record the expected output, and rerun those tests after every dependency update. This catches silent changes, which are more dangerous than obvious failures.
You should also understand the read path. Position reads depend on the blockchain nodes your configuration points to. A slow or out-of-date node can return delayed results, so decide which provider you trust and how you will detect lag.
How do I set up the SDK in a project?
A typical setup follows a clear sequence. The exact commands and package names can change, so follow the current README rather than any copied snippet.
- Confirm the official repository and its license. Note the supported Node.js version and the required package manager.
- Create a clean project and install the SDK at a pinned version. Avoid floating version ranges for a financial data component.
- Configure your blockchain connections. Use an RPC provider you have contracted with, store its credentials in environment variables, and never place them in client-side code.
- Call the position-reading function for a test address you control. Keep the address public in your tests, and never use a private key in a read-only script.
- Compare the output with a block explorer or a protocol's own interface for the same address. Note any mismatch.
- Wrap the call in error handling. Chains can time out, and some addresses may hold positions the adapters do not yet cover.
- Add caching with a short expiry, so repeated page loads do not flood your node provider.
- Write tests with fixtures, then deploy behind a feature flag so you can switch off a faulty adapter quickly.
Keep the integration in a single module. Other parts of your app should call your wrapper, not the SDK directly. That makes future upgrades and replacements far easier.
How do I check that the data is accurate and safe to show?
Position data is only as good as its inputs and its interpretation. Several checks should be part of any integration.
First, validate addresses before you query them. Reject malformed input early, and normalise casing so that the same wallet does not produce two cache entries.
Second, separate raw position amounts from valuations. A token amount is a fact read from the chain. A dollar value depends on a price source, a timestamp and a method. Show the two separately where possible, and label the valuation time clearly.
Third, detect partial results. If one adapter fails, the rest of the data may still be useful, but users must know that the total is incomplete. Surface warnings rather than showing a confident total that quietly omits a protocol.
Fourth, reconcile on a schedule. Pick a sample of wallets with known positions and compare your app's output with an independent source each week or each release. Log discrepancies and investigate them rather than assuming the library is right.
Finally, treat security as part of data quality. Keep dependencies updated, review changelogs, and watch for unexpected changes in contract addresses or adapter behaviour. A compromised dependency can display false balances just as easily as it can display true ones.
What are the common pitfalls and limits?
Several limits are worth planning for from the start.
Coverage is the most common surprise. A wallet may hold positions in a new protocol, a niche vault or a chain that the SDK does not yet read. Your interface should say that coverage is limited rather than implying a complete view.
Timing is another issue. Onchain state changes with every block, but your cache does not. Users who just deposited or repaid a loan may see outdated numbers. Show the time of the last read and offer a manual refresh.
Rate limits and node costs can grow quickly. Each position read may make many contract calls. Batch requests where the library allows it, and avoid reading every wallet on every page view.
Protocol upgrades can break assumptions. A contract migration may move positions to a new address, and an adapter may briefly report zero. Compare totals before and after a known upgrade window, and keep a rollback path.
Lastly, be careful with language. A position reader shows what is on the chain. It does not show whether a position is safe, profitable or suitable for a given person. Avoid wording that suggests the tool gives investment recommendations, and add a plain reminder that crypto values can fall sharply and that users should check local rules before using any crypto-related product.
How do I keep up with changes and confirm current status?
Because the DeFi landscape changes quickly, a guide like this should point you to the live sources rather than claim a fixed state of support.
Start with the official repository. Look at the date of the latest release, the open issues, and whether maintainers respond to bug reports. Activity is a useful signal, although a quiet repository is not always abandoned, so check the commit history and the documentation together.
Next, check the protocols and chains listed in the documentation against the ones your users need. If a protocol you care about is missing, decide whether to contribute an adapter, wait, or use another source for that part of the data.
Then review the dependency tree and the license. Open source code is not automatically safe. Read what your build pulls in and run your usual security scanning.
Finally, set a review date. Put a calendar reminder to recheck coverage, pricing sources and node providers every few months, and after any major protocol upgrade you rely on. Record what you verified and when, so your team can see how current the integration is.
Frequently asked questions
Is the Zerion DeFi SDK the same as the Zerion API?
No. The Zerion DeFi SDK is a code library that developers include in their own projects. The Zerion API is a hosted service you call over HTTP. Both aim at portfolio and position data, but they are built and used differently, so confirm which one fits your architecture before you start.
How can I check which protocols the SDK supports right now?
Read the repository's README, its list of supported protocols and chains, and its recent commit and release history. Those sources show what the library covers today. Protocol support changes as projects upgrade their contracts, so treat any list in an article, including this one, as a starting point rather than a guarantee.
Does using the SDK change how I should handle user data?
Public onchain data is visible to anyone, but any tool that reads it still needs careful handling. Only display balances and positions you have verified against a source you trust, and avoid presenting a dashboard as financial advice. If your app serves users in regulated markets, check local rules on crypto-related services with a qualified adviser.
Can I rely on the SDK alone for accurate portfolio values?
Not necessarily. Pricing, valuation and position math can differ between data providers, and an SDK may not cover every protocol a user holds. Many teams combine a position reader with a price feed or an indexing service, then reconcile the results. Test with real wallets you control before you rely on any figure in production.
What should I do before adding the SDK to a production app?
Start from the official repository and its documentation, since the GitHub public reporting includes a separate third-party TypeScript SDK for the Zerion API. Check the license, the maintainers, and the open issues before adopting any library. Pin a specific version in your project so updates do not change behaviour without your review.
Mentioned in this guide
dApps in this guide
The Graph is a decentralized indexing protocol that lets developers query blockchain data through GraphQL subgraphs, powered by the GRT token.
Envio is a blockchain indexing and data platform offering HyperIndex APIs and fast HyperSync raw data access for developers across 81+ chains.
DefiLlama is a data site that aggregates total value locked, trading volume and fees for DeFi protocols across many chains.
dRPC is a multichain RPC provider offering managed cloud endpoints, an open-source load balancer and chain infrastructure tools for developers and foundations.
Sequence is a developer infrastructure stack for smart wallets, 1-click cross-chain payments and real-time multi-chain data on EVM networks.
Chainlink is a decentralized oracle network that supplies real-world data to smart contracts, with the LINK token used to pay for services.
Sharpe is a free crypto trading intelligence terminal with derivatives data from 35 venues, rug checks, narrative tracking and an API and MCP server for agents.
DeFipedia is an educational website for readers exploring DeFi, with articles, a glossary, protocol reviews and community Q&A.
Pyth Network is a first-party price oracle and market data provider for blockchain apps, trading venues and institutions, with its own PYTH token.
Keep reading
Related guides
Wallets and tools · Explainer
Blockchain Notifications and Alerts: Tools and Setup
Blockchain alerts turn on-chain events, wallet activity and market movements into notifications you can act on. Learn how alert tools work, which type fits your needs, and how to set them up safely.
Wallets and tools · Explainer
What Is a Crypto API? Types, Uses and Safety in 2026
A crypto API lets software request blockchain, market, or exchange services without building every connection from scratch. Learn how the main types work, what they can—and cannot—do, and how to choose one safely.
Blockchain · Explainer
Stellar Soroban Smart Contracts and DeFi: A 2026 Explainer
Stellar's Soroban adds Turing-complete smart contracts to a network originally built for payments and asset issuance. This guide explains what that means for DeFi builders and users, and what to check before you use any app.
Wallets and tools · Explainer
CryptoCompare Guide: What It Does and How to Use It
CryptoCompare is a cryptocurrency market-data platform, not a wallet or exchange. Learn what its website and API can do, how to interpret the data, and what to check before relying on it.
Wallets and tools · How-to
Interacting With Smart Contracts Using AlgoSigner and WalletConnect
AlgoSigner is a legacy browser signing tool for Algorand, while WalletConnect lets a phone wallet approve Algorand dApp requests without exposing keys. This guide explains how to connect, read each transaction, and approve smart contract calls safely.
Wallets and tools · Review
Zengo Wallet Review: How Keyless Keys and Recovery Work
Zengo is a self-custody wallet that avoids the seed phrase by splitting signing keys across devices and servers. This guide explains how that works, where the trade-offs sit, and what to check before you rely on it.
Wallets and tools · Explainer
Anchorage Digital: Crypto Custody and Services
Anchorage Digital provides crypto custody and related services for institutions, not a general-purpose wallet for everyday users. Learn how its custody, staking, trading and regulatory setup work—and what to check before choosing a custodian.
Wallets and tools · Explainer
Zengo Wallet: Features, Security, and How It Works
Zengo is a self-custody crypto wallet that uses multi-party computation (MPC) instead of a traditional seed phrase. Learn how its security model works, what you can do in the app, and what to check before using it.