Skip to main content

How do I get wallet balances and DeFi positions?

Call GET /v1/wallet/balances before and after execution. Set useEoa to true when reading an EOA, or false for the associated Enso wallet.

J
Written by Javier Diaz

Call GET /v1/wallet/balances before and after execution. Set useEoa to true when reading an externally owned account, or to false for the associated Enso wallet.

Definition

A balance read returns the tokens a wallet holds, including DeFi position tokens, so your app can choose tokenIn, show current positions, and confirm a swap or deposit after confirmation.

How it works

  • Before you quote, read balances so the user can pick from assets they actually hold.

  • After the transaction confirms, read them again to refresh the portfolio and any new position tokens.

  • For a cross-chain route, wait until destination delivery is confirmed before treating destination balances as final.

  • Pair the amounts with token metadata when you need names, logos, underlying assets, or yield data.

How Enso does this

Call GET https://api.enso.build/api/v1/wallet/balances with eoaAddress and useEoa. You can pass a chainId or request all supported chains. The response includes token, amount, decimals, price, name, symbol, logoUri, and chainId. Use useEoa=true for the provided address; set it to false to read the associated Enso wallet. See Get Balances. Combine this with GET /api/v1/tokens when you need richer position metadata.

FAQ

Does this endpoint return only wallet cash tokens?

No. It returns balances across protocols and networks Enso supports, including DeFi position tokens, as shown in the balances guide.

Should I cache balances instead of refreshing after a transaction?

Refresh after confirmation (and after destination delivery for cross-chain routes). A cached read can miss the new position or the reduced tokenIn balance.

Related articles

  • How do I discover tokens, vaults, and protocols from the API?

  • How do I add an Earn tab to a wallet or app?

  • How do I show a quote before the user signs?

  • What is destination-chain delivery?

  • What is Enso Earn?

Sources

Did this answer your question?