walletPositions
Fetch DeFi positions for one or more wallets across protocols.
walletPositions(inputs: [PositionInput!]!): MultiPositionResponse!
Returns all positions a wallet holds in one or more protocols. Supports partial success — if one protocol fails, the others still return data.
Warning
Maximum 5 inputs per request. Requests with more than 5 inputs are rejected.
Warning
Rate limit: 100 requests per 60-second window. Maximum 5 inputs per request. Exceeding the limit returns HTTP 429.
Input
input PositionInput {
protocol: String! # "morpho" | "pendle" | "aave" | "neutrl" | "avantis" | "avant" | "fluid" | "midas" | "compound"
chainId: Int! # Chain ID (e.g. 1 for Ethereum, 8453 for Base)
walletAddress: String! # Wallet address (hex, checksummed or lowercase)
}| Field | Type | Description |
|---|
| protocol | String! | Protocol identifier. One of: morpho, pendle, aave, neutrl, avantis, avant, fluid, midas, compound |
| chainId | Int! | Blockchain network ID. See supported chains for valid chain IDs per protocol |
| walletAddress | String! | Wallet address to query positions for |
Response
type MultiPositionResponse {
data: [WalletPositionResult!]! # Successfully resolved positions
errors: [ProtocolError!]! # Errors for failed protocol/chain/wallet tuples
}The data array contains a union type — each protocol returns its own typed response. Use GraphQL inline fragments to select protocol-specific fields.
union WalletPositionResult =
| MorphoWalletPositions
| PendleWalletPositions
| AaveWalletPositions
| NeutrlWalletPositions
| AvantisWalletPositions
| AvantWalletPositions
| FluidWalletPositions
| MidasWalletPositions
| CompoundWalletPositions
Note
Partial failures: If one protocol fails, the others still return data. Always check both data and errors arrays in the response.
Multi-protocol example
Query multiple protocols in a single request:
query {
walletPositions(inputs: [
{ protocol: "morpho", chainId: 1, walletAddress: "0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b6" }
{ protocol: "aave", chainId: 1, walletAddress: "0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b6" }
{ protocol: "compound", chainId: 1, walletAddress: "0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b6" }
]) {
data {
... on MorphoWalletPositions {
protocol walletAddress chainId
vaultV2Positions { vaultName assetsUsd apy }
marketPositions { marketId supply { assetsUsd } borrow { assetsUsd } }
}
... on AaveWalletPositions {
protocol walletAddress chainId
marketStates { marketName netWorth healthFactor }
supplyPositions { currency { symbol } balanceUsd apy { formatted } }
}
... on CompoundWalletPositions {
protocol walletAddress chainId
supplyPositions { baseAsset { symbol } balanceUsd apr }
rewardPositions { rewardToken { symbol } accruedUsd }
}
}
errors {
protocol chainId walletAddress
error { code message retryable }
}
}
}{
"data": {
"walletPositions": {
"data": [
{
"protocol": "morpho",
"walletAddress": "0x742d35cc6634c0532925a3b8d4c9db96c4b4d8b6",
"chainId": 1,
"vaultV2Positions": [
{ "vaultName": "Morpho Blue USDC", "assetsUsd": 10250.0, "apy": 0.0685 }
],
"marketPositions": [
{
"marketId": "0xb323495f7e4148be5643a4ea4a8221eef163e4bccfdedc2a6f4696baacbc86cc",
"supply": { "assetsUsd": 5000.0 },
"borrow": { "assetsUsd": 0.0 }
}
]
},
{
"protocol": "aave",
"walletAddress": "0x742d35cc6634c0532925a3b8d4c9db96c4b4d8b6",
"chainId": 1,
"marketStates": [
{ "marketName": "Aave V3 Ethereum", "netWorth": 15234.56, "healthFactor": 1.85 }
],
"supplyPositions": [
{ "currency": { "symbol": "WETH" }, "balanceUsd": 16500.42, "apy": { "formatted": "1.98%" } }
]
},
{
"protocol": "compound",
"walletAddress": "0x742d35cc6634c0532925a3b8d4c9db96c4b4d8b6",
"chainId": 1,
"supplyPositions": [
{ "baseAsset": { "symbol": "USDC" }, "balanceUsd": 10000.0, "apr": 0.035 }
],
"rewardPositions": [
{ "rewardToken": { "symbol": "COMP" }, "accruedUsd": 250.0 }
]
}
],
"errors": []
}
}
}Per-protocol query examples
See Morpho protocol page for the full query with all vault and market fields.
... on MorphoWalletPositions {
protocol walletAddress chainId
vaultV1Positions { vaultName shares assets assetsUsd apy underlyingAsset { symbol } }
vaultV2Positions { vaultName shares assets assetsUsd apy underlyingAsset { symbol } }
marketPositions {
marketId
loanAsset { symbol } collateralAsset { symbol }
supply { assets assetsUsd } borrow { assets assetsUsd } collateral { assets assetsUsd }
healthFactor
marketMetrics { supplyApy borrowApy lltv utilization }
}
}See Aave protocol page for the full query with all position fields.
... on AaveWalletPositions {
protocol walletAddress chainId
marketStates { marketName netWorth healthFactor totalCollateralBase totalDebtBase }
supplyPositions {
currency { symbol } balance { value raw } balanceUsd
apy { value formatted } isCollateral canBeCollateral
}
borrowPositions {
currency { symbol } debt { value raw } debtUsd apy { value formatted }
}
reserves { underlyingTokenAddress aToken { symbol } vToken { symbol } }
}See Pendle protocol page for the full query with all position types.
... on PendleWalletPositions {
protocol walletAddress chainId
ptPositions { ptToken { symbol } balanceUsd impliedApy lockedApy expiryDate ptDiscount }
ytPositions { ytToken { symbol } balanceUsd impliedApy expiryDate accruedInterest }
lpPositions { lpToken { symbol } balanceUsd lpApy impliedApy expiryDate }
syPositions { syToken { symbol } balanceUsd }
}See Fluid protocol page for the full query including smart vault fields.
... on FluidWalletPositions {
protocol walletAddress chainId
lendingPositions {
fTokenSymbol underlyingAsset { symbol } balanceUsd apy
rewards { tokenSymbol rate rewardType }
}
vaultPositions {
nftId isSmartCol isSmartDebt supply borrow
supplyToken { symbol } borrowToken { symbol }
collateralFactor liquidationThreshold
}
}See Compound protocol page for the full query with all position types.
... on CompoundWalletPositions {
protocol walletAddress chainId
supplyPositions { baseAsset { symbol } balance balanceUsd apr }
borrowPositions { baseAsset { symbol } debt debtUsd apr }
collateralPositions { asset { symbol } balance balanceUsd }
rewardPositions { rewardToken { symbol } accrued accruedUsd }
}Neutrl, Avantis, and Avant share a similar vault structure. See their individual pages for details.
... on NeutrlWalletPositions {
protocol walletAddress chainId
vaultPosition { vaultAddress balance balanceUsd apy exchangeRate vaultMetrics { totalAssets totalSupply } }
}
... on AvantisWalletPositions {
protocol walletAddress chainId
vaultPosition { vaultAddress balance balanceUsd apy exchangeRate vaultMetrics { totalAssets totalSupply } }
}
... on AvantWalletPositions {
protocol walletAddress chainId
vaultPosition { vaultAddress balance balanceUsd apy exchangeRate vaultMetrics { totalAssets totalSupply } }
}See Midas protocol page for the full query.
... on MidasWalletPositions {
protocol walletAddress chainId
tokenPositions { tokenAddress symbol balance balanceUsd apy oraclePrice }
}Error response
When a protocol fails, it appears in the errors array while successful protocols return in data:
Partial failure response
{
"data": {
"walletPositions": {
"data": [
{
"protocol": "morpho",
"walletAddress": "0x742d35cc6634c0532925a3b8d4c9db96c4b4d8b6",
"chainId": 1,
"vaultV2Positions": [{ "...": "..." }],
"marketPositions": []
}
],
"errors": [
{
"protocol": "aave",
"chainId": 1,
"walletAddress": "0x742d35cc6634c0532925a3b8d4c9db96c4b4d8b6",
"error": {
"code": "PROTOCOL_ERROR",
"message": "Chain not supported by Aave adapter",
"retryable": false
}
}
]
}
}
}