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.

GET/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>"
Parameters
ParameterDescription
chain

path · 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.
address

path · 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.

Response fields of DeFi positions of a wallet, with USD value
FieldTypeDescription
completebooleanWhether 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.
totalValueUsdnumber | nullThe 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.
totalUnclaimedUsdnumber | nullThe summed USD value of rewards accrued but not yet claimed. null when no position reports one, or the list is incomplete.
protocolsobject[]One entry per protocol, in the order each first appears in positions.
protocols[].protocolIdstring | nullA stable identifier for the protocol, e.g. "aave-v3".
protocols[].protocolNamestring | nullThe protocol's display name.
protocols[].protocolUrlstring | nullThe protocol's website.
protocols[].positionCountintegerHow many of positions belong to this protocol.
protocols[].valueUsdnumber | nullThe 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[].unclaimedUsdnumber | nullThe summed unclaimed rewards in USD; null when none is reported.
positionsobject[]Every position, in the order the data lists them.
positions[].protocolIdstring | nullThe protocol the position is in.
positions[].protocolNamestring | nullThe protocol's display name.
positions[].protocolUrlstring | nullThe protocol's website.
positions[].kindstring | nullThe kind of position: lending, liquidity, staking, vesting, yield, vault or other.
positions[].addressstring | nullThe contract the position lives in.
positions[].valueUsdnumber | nullThe 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[].unclaimedUsdnumber | nullRewards accrued but not yet claimed, in USD.
positions[].isDebtboolean | nullWhether the position carries debt (a borrow against it). false is a real answer, distinct from null.
positions[].healthFactornumber | nullA 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[].poolAddressstring | nullA liquidity position's pool address.
positions[].tokensobject[] | nullThe position's tokens. null when the source sent the position without its token list.
positions[].tokens[].rolestring | nullThe token's part in the position: supplied, borrowed, reward, …
positions[].tokens[].addressstring | nullThe token contract address.
positions[].tokens[].symbolstring | nullThe token symbol.
positions[].tokens[].namestring | nullThe token name.
positions[].tokens[].decimalsinteger | nullThe token's decimals.
positions[].tokens[].amountstring | nullThe amount in whole tokens, as a decimal string.
positions[].tokens[].amountRawstring | nullThe amount in raw base units, as a decimal string.
positions[].tokens[].priceUsdnumber | nullThe token's USD price; null when it cannot be priced — never 0.
positions[].tokens[].valueUsdnumber | nullThe 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