Compound logo
Protocol

Compound API

Compound V3 (Comet) is a lending protocol where each market has a single borrowable base asset and multiple collateral assets. The API returns supply, borrow, collateral, and reward positions per market.

Supported chains

EthereumBaseArbitrum

Available data

Supply Positions

Base asset deposits earning interest with balance and APR

Borrow Positions

Base asset debt with outstanding amount and APR

Collateral Positions

Assets backing borrows — collateral does not earn interest

Reward Positions

Unclaimed COMP rewards accrued from the CometRewards contract

Notes

  • Compound uses APR (not compounded), not APY — 0.035 means 3.5% APR
  • 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

Example query

query.graphql
query {
  walletPositions(inputs: [
    { protocol: "compound", chainId: 1, walletAddress: "0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b6" }
  ]) {
    data {
      ... on CompoundWalletPositions {
        protocol
        walletAddress
        chainId
        supplyPositions {
          baseAsset { symbol }
          balanceUsd
          apr
        }
        borrowPositions {
          baseAsset { symbol }
          debtUsd
          apr
        }
        collateralPositions {
          asset { symbol }
          balanceUsd
        }
        rewardPositions {
          rewardToken { symbol }
          accruedUsd
        }
      }
    }
    errors { protocol error { code message } }
  }
}
Try in PlaygroundView full docs

Other protocols

MorphoMorphoAaveAavePendlePendleFluidFluidAvantAvantAvantisAvantisNeutrlNeutrlMidasMidas