Skip to main content
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.
Maximum 5 inputs per request. Requests with more than 5 inputs are rejected.
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)
}
FieldTypeDescription
protocolString!Protocol identifier. One of: morpho, pendle, aave, neutrl, avantis, avant, fluid, midas, compound
chainIdInt!Blockchain network ID. See supported chains for valid chain IDs per protocol
walletAddressString!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
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 }
    }
  }
}

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 }
  }
}

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
          }
        }
      ]
    }
  }
}