Wallet positions (tokens, Aave v3, Uniswap v3)
POST /api/wallet-positionsAn EVM wallet's positions on up to 5 chains (base, ethereum, arbitrum, optimism, polygon), read from our own chain reads pinned to one block per chain...
Details
An EVM wallet's positions on up to 5 chains (base, ethereum, arbitrum, optimism, polygon), read from our own chain reads pinned to one block per chain: native coin and listed-token balances valued in USD from Uniswap v3 USDC pool state at that block (null with the reason when no pool is usable), Aave v3 collateral, debt, available borrows and health factor from the lending pool's own account data, and Uniswap v3 liquidity positions (count, pair, fee, range, liquidity, in-range flag). A chain that could not be read is listed with its state, never as empty. At most 7 reads per chain.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
address | string | yes | 0x-prefixed 40-hex EVM wallet address. Also accepted as addr, wallet, account. The example sends 0xBA9424d650A4F5c80a0dA641254d1AcCE2A37057. |
networks | array of string | no | 1-5 of base, ethereum, arbitrum, optimism, polygon (default: all). One of base, ethereum, arbitrum, optimism, polygon. |
Example request
curl -i -X POST https://agent402.tools/api/wallet-positions \
-H "Content-Type: application/json" \
-d '{"address":"0xBA9424d650A4F5c80a0dA641254d1AcCE2A37057","networks":["base"]}'Watch a call get paid
POST /api/wallet-positions$0.01 USDCPAYMENT-SIGNATUREon 14 chains200 OKAgent402-ReceiptEd25519Example response
{
"address": "0xba9424d650a4f5c80a0da641254d1acce2a37057",
"networks": [
"base"
],
"chains": [
{
"network": "base",
"chainId": 8453,
"state": "ok",
"block": 63850824,
"asOf": "2026-11-29T13:55:40.000Z",
"native": {
"symbol": "ETH",
"amount": "121.382782053014705395",
"raw": "121382782053014705395",
"priceUsd": 1651.415954,
"valueUsd": 200453.46,
"pricePool": "0x6c561b446416e1a00e8e93e221854d6ea4171372",
"priceFee": 3000
},
"tokens": [
{
"symbol": "USDC",
"contract": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"decimals": 6,
"amount": "57.088192",
"raw": "57088192",
"priceUsd": 1,
"valueUsd": 57.09
},
{
"symbol": "WETH",
"contract": "0x4200000000000000000000000000000000000006",
"decimals": 18,
"amount": "0.000000551084358507",
"raw": "551084358507",
"priceUsd": 1651.415954,
"valueUsd": 0,
"pricePool": "0x6c561b446416e1a00e8e93e221854d6ea4171372",
"priceFee": 3000
},
{
"symbol": "cbBTC",
"contract": "0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf",
"decimals": 8,
"amount": "0.00002831",
"raw": "2831",
"priceUsd": 59610.15892,
"valueUsd": 1.69,
"pricePool": "0xfbb6eed8e7aa03b138556eedaf5d271a5e1e43ef",
"priceFee": 500
},
{
"symbol": "USDbC",
"contract": "0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca",
"decimals": 6,
"amount": "18.347622",
"raw": "18347622",
"priceUsd": 1.000062224,
"valueUsd": 18.35,
"pricePool": "0x06959273e9a65433de71f5a452d529544e07ddd0",
"priceFee": 100
},
{
"symbol": "DAI",
"contract": "0x50c5725949a6f0c72e6c4a641f24049a917db0cb",
"decimals": 18,
"amount": "0.15493852174189475",
"raw": "154938521741894750",
"priceUsd": 0.998638668,
"valueUsd": 0.15,
"pricePool": "0xc18f50d6a832f12f6dcaaeee8d0c87a65b96787e",
"priceFee": 100
},
{
"symbol": "EURC",
"contract": "0x60a3e35cc302bfa44cb288bc5a4f316fdb1adb42",
"decimals": 6,
"amount": "225.564841",
"raw": "225564841",
"priceUsd": 1.092643754,
"valueUsd": 246.46,
"pricePool": "0x7279c08a36333e12c3fc81747963264c100d66fb",
"priceFee": 500
},
{
"symbol": "cbETH",
"contract": "0x2ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec22",
"decimals": 18,
"amount": "0.058436688083898054",
"raw": "58436688083898054",
"priceUsd": 1887.53514,
"valueUsd": 110.3,
"pricePool": "0xa8e4c55d6daf4d768aeba2378c1ad94c112ef48a",
"priceFee": 3000
},
{
"symbol": "wstETH",
"contract": "0xc1cba3fcea344f92d9239c08c0568f6f2f0ee452",
"decimals": 18,
"amount": "0.162843927342213699",
"raw": "162843927342213699",
"priceUsd": 2068.330256,
"valueUsd": 336.82,
"pricePool": "0x45837e65e4c44ca260ab40e6dc30ff1b466a00ca",
"priceFee": 500
},
{
"symbol": "AERO",
"contract": "0x940181a94a35a4569e4529a3cdfb74e38fd98631",
"decimals": 18,
"amount": "12.967561957339302173",
"raw": "12967561957339302173",
"priceUsd": 0.3774879066,
"valueUsd": 4.9,
"pricePool": "0xe5b5f522e98b5a2baae212d4da66b865b781db97",
"priceFee": 500
}
],
"tokensChecked": 9,
"aaveV3": {
"state": "ok",
"pool": "0xa238dd80c259a72e81d7e4664a9801593f98d1c5",
"hasPosition": true,
"collateralUsd": 540796.356276,
"debtUsd": 0,
"availableBorrowsUsd": 218157.250122,
"liquidationThresholdBps": 8059,
"ltvBps": 4034,
"healthFactor": null,
"healthFactorReason": "no debt",
"valueBasis": "Aave's own price oracle, in the market's USD base currency"
},
"uniswapV3": {
"state": "ok",
"positionManager": "0x03a520b32c04bf3beef7beb72e919cf822ed34f1",
"positions": 0,
"open": 0,
"closed": 0,
"inRange": 0,
"outOfRange": 0,
"items": [],
"returned": 0,
"matched": 0,
"complete": true,
"truncated": false,
"valueUsd": null,
"valueReason": "liquidity position values are not computed; count, range and liquidity only"
},
"walletTokensUsd": 201229.22,
"unpricedRows": 0,
"reads": 4
}
],
"totals": {
"walletTokensUsd": 201229.22,
"aaveCollateralUsd": 540796.36,
"aaveDebtUsd": 0,
"uniswapV3Positions": 0,
"unpricedRows": 0,
"basis": "Sums over the chains read; unpriced rows and liquidity positions are not in the USD totals."
},
"chainsRead": 1,
"chainsRequested": 1,
"complete": true,
"method": {
"balances": "Native coin and the listed tokens' balanceOf, one batched read at the chain's latest block; tokens outside the list are not read (tokensChecked).",
"prices": "USDC is the quote unit and is counted as 1 USD; every other price is the token's Uniswap v3 spot price in USDC at the answer's block (the one of its USDC pools with the most in-range liquidity), not an exchange or oracle price.",
"aaveV3": "The Aave v3 pool's getUserAccountData at the same block: collateral, debt and available borrows in the market's base currency (USD, 8 decimals) as valued by Aave's own price oracle; collateral counts only assets enabled as collateral.",
"uniswapV3": "The position manager's balanceOf and, for up to 10 positions, positions(tokenId); inRange compares the pool's slot0 tick with the position's ticks. A position with zero liquidity is counted as closed. Position USD values are not computed."
},
"reads": {
"rpcCalls": 4,
"maxPerChain": 7
},
"fetchedAt": "2026-11-29T13:55:40.730Z"
}| Field | Type | Always present | In the example |
|---|---|---|---|
address | string | yes | 0xba9424d650a4f5c80a0da641254d1acce2a37057 |
networks | array of string | yes | 1 item in the example |
chains | array of objects | yes | 1 item in the example |
totals | object | yes | 6 fields: walletTokensUsd, aaveCollateralUsd, aaveDebtUsd and 3 more |
chainsRead | number | yes | 1 |
chainsRequested | number | yes | 1 |
complete | boolean | yes | true |
method | object | yes | 4 fields: balances, prices, aaveV3, uniswapV3 |
reads | object | yes | 2 fields: rpcCalls, maxPerChain |
fetchedAt | string | yes | 2026-11-29T13:55:40.730Z |
From an MCP client
catalog.call {
"slug": "wallet-positions",
"params": {
"address": "0xBA9424d650A4F5c80a0dA641254d1AcCE2A37057",
"networks": [
"base"
]
}
}Hosted connector (https://agent402.tools/mcp): paid in the call. Stdio package (npx -y agent402-mcp@0.18.0): pays from a wallet or an AGENT402_CREDITS_KEY issued earlier.
Errors and behavior
- Pay $0.01 per call over x402 or MPP. Wallet-only: this tool reaches the network or stored state, so it has no proof-of-work tier. A card-credits key issued earlier (
Authorization: Bearer a402_...) also pays it. - Required:
address; a rejected input answers 4xx witherror,tool,expected,requiredandexample. - On this route, a call ending in any status of 400 or above is not charged over x402, MPP or a credits key. A Tempo push credential pays before the call; a failure is a refund owed.
- A bodyless
GETorHEADreturns the same 402 quote. - An
Idempotency-Keyreplays the first 200 uncharged (an answer larger than 1 MB is not replayed).
Paid call (JavaScript agent)
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
client.setSpendControls?.({ maxAmountPerPayment: "$0.01" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.AGENT_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/wallet-positions", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"address": "0xBA9424d650A4F5c80a0dA641254d1AcCE2A37057",
"networks": [
"base"
]
}),
});Get a wallet or run npx -y agent402-mcp@0.18.0 wallet new.
The quote (Python)
import base64, json, urllib.error, urllib.request
req = urllib.request.Request("https://agent402.tools/api/wallet-positions", method="POST", data="{\"address\":\"0xBA9424d650A4F5c80a0dA641254d1AcCE2A37057\",\"networks\":[\"base\"]}".encode(), headers={"Content-Type": "application/json"})
try:
urllib.request.urlopen(req)
except urllib.error.HTTPError as e:
quote = json.loads(base64.b64decode(e.headers["PAYMENT-REQUIRED"]))
print(e.code, [(a["network"], a["amount"]) for a in quote["accepts"]]) # the price, per chain, in base units