Skip to main content
Compound V3 (Comet) is a lending protocol where each market has a single borrowable base asset and multiple collateral assets. The API returns four position types per market.

Supported chains

Chain IDNetwork
1Ethereum
8453Base
42161Arbitrum

Position types

Type identifierDescriptionKey fields
compound-supplyBase asset earning interestbaseAsset, balance, balanceUsd, apr
compound-borrowBase asset debtbaseAsset, debt, debtUsd, apr
compound-collateralCollateral backing borrows (no interest)asset, balance, balanceUsd
compound-rewardUnclaimed COMP rewardsrewardToken, accrued, accruedUsd

walletPositions example

query {
  walletPositions(inputs: [
    { protocol: "compound", chainId: 1, walletAddress: "0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b6" }
  ]) {
    data {
      ... on CompoundWalletPositions {
        protocol walletAddress chainId
        supplyPositions {
          type marketAddress
          baseAsset { address symbol decimals }
          balance balanceUsd apr
        }
        borrowPositions {
          type marketAddress
          baseAsset { address symbol decimals }
          debt debtUsd apr
        }
        collateralPositions {
          type marketAddress
          asset { address symbol decimals }
          balance balanceUsd
        }
        rewardPositions {
          type marketAddress
          rewardToken { address symbol decimals }
          accrued accruedUsd
        }
      }
    }
    errors { protocol chainId walletAddress error { code message retryable } }
  }
}

Notes

Compound uses APR (annualized rate, not compounded), not APY. A value of 0.035 means 3.5% APR.
  • Each Comet market has a single borrowable base asset (e.g., USDC or WETH). A wallet cannot simultaneously supply and borrow the base asset in the same market
  • Collateral positions do not earn interest — they only back borrow positions
  • Reward positions show unclaimed COMP accrued from the CometRewards contract
  • balance and debt are raw BigInt strings
  • Individual market failures are skipped without blocking other markets