Wallets API
DeFi positions of a wallet, with USD value
A wallet's DeFi positions on one chain — lending, liquidity, staking, vaults — with tokens, USD values, unclaimed rewards, debt, health factor and per-protocol totals. ETH, BNB, BASE.
/api/external/wallet-analysis/wallet-defi-positions/{chain}/{address}What it returns
Every position one wallet holds inside DeFi protocols on one chain — supplied to a lending market, provided as liquidity, staked, vesting, in a vault — with the tokens in each and their USD value, plus per-protocol and overall totals derived from those positions. Values are net of debt: a lending position is worth what it supplies minus what it borrows. Not the tokens the wallet holds directly (that is the wallet portfolio). ETH, BNB and BASE only; every other chain returns 400. A wallet with no position answers an empty list and a total of 0. A token the data cannot price has a null price and value — never 0; a real 0 is a priced zero balance. Spam tokens are not filtered and may carry a USD value. complete is false when the wallet holds more positions than one page of up to 100 carries: the list is then partial and every total is null, because a sum over part of the positions is not the wallet's total.
Chains
- BNB Chain BNB
- Ethereum ETH
- Base BASE
Request
Send your key in the x-dex-data-key header. Replace each <placeholder> with a real value.
curl -H "x-dex-data-key: $DEXDATA_API_KEY" \ "https://api.dexdata.io/api/external/wallet-analysis/wallet-defi-positions/BNB/<address>"
| Parameter | Description |
|---|---|
chainpath · string · required | The chain the wallet address belongs to. ETH, BNB and BASE are served; SOL, STABLE, RHC and ARC all return 400. CELO, ARB, OP and SCROLL return 400 here. |
addresspath · string · required | The wallet address. |
Response fields
A JSON response. Every field is always present; null means the value could not be established, never zero.
| Field | Type | Description |
|---|---|---|
complete | boolean | Whether every position the wallet holds on this chain is listed. false when the wallet holds more positions than one page of up to 100 carries; every total, overall and per protocol, is then null. |
totalValueUsd | number | null | The summed USD value of every position, net of debt. 0 for a wallet with no position; null when the list is incomplete or any position could not be priced, because a sum that skips a position is not the wallet's total. |
totalUnclaimedUsd | number | null | The summed USD value of rewards accrued but not yet claimed. null when no position reports one, or the list is incomplete. |
protocols | object[] | One entry per protocol, in the order each first appears in positions. |
protocols[].protocolId | string | null | A stable identifier for the protocol, e.g. "aave-v3". |
protocols[].protocolName | string | null | The protocol's display name. |
protocols[].protocolUrl | string | null | The protocol's website. |
protocols[].positionCount | integer | How many of positions belong to this protocol. |
protocols[].valueUsd | number | null | The summed USD value of this protocol's positions, net of debt; null when any of them could not be priced or the list is incomplete. |
protocols[].unclaimedUsd | number | null | The summed unclaimed rewards in USD; null when none is reported. |
positions | object[] | Every position, in the order the data lists them. |
positions[].protocolId | string | null | The protocol the position is in. |
positions[].protocolName | string | null | The protocol's display name. |
positions[].protocolUrl | string | null | The protocol's website. |
positions[].kind | string | null | The kind of position: lending, liquidity, staking, vesting, yield, vault or other. |
positions[].address | string | null | The contract the position lives in. |
positions[].valueUsd | number | null | The position's USD value net of its debt (supplied minus borrowed), counting the tokens that could be priced; null when it cannot be priced at all. |
positions[].unclaimedUsd | number | null | Rewards accrued but not yet claimed, in USD. |
positions[].isDebt | boolean | null | Whether the position carries debt (a borrow against it). false is a real answer, distinct from null. |
positions[].healthFactor | number | null | A lending position's health factor (below 1 is liquidatable). null when not a lending position, not reported, or the account has no debt — a lending market reports an effectively infinite value for an account that borrows nothing, and that value is not a measurement. |
positions[].poolAddress | string | null | A liquidity position's pool address. |
positions[].tokens | object[] | null | The position's tokens. null when the source sent the position without its token list. |
positions[].tokens[].role | string | null | The token's part in the position: supplied, borrowed, reward, … |
positions[].tokens[].address | string | null | The token contract address. |
positions[].tokens[].symbol | string | null | The token symbol. |
positions[].tokens[].name | string | null | The token name. |
positions[].tokens[].decimals | integer | null | The token's decimals. |
positions[].tokens[].amount | string | null | The amount in whole tokens, as a decimal string. |
positions[].tokens[].amountRaw | string | null | The amount in raw base units, as a decimal string. |
positions[].tokens[].priceUsd | number | null | The token's USD price; null when it cannot be priced — never 0. |
positions[].tokens[].valueUsd | number | null | The USD value of amount, positive for a borrowed token too (its role says it is debt); null when unpriceable. 0 is a priced zero balance. |
Start building with DexData today
Sign in, create a key and make your first call in a minute. Free credits every month, and you only pay for calls that succeed.
Get a free API key