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 ID | Network |
|---|
| 1 | Ethereum |
| 8453 | Base |
| 42161 | Arbitrum |
Position types
| Type identifier | Description | Key fields |
|---|
compound-supply | Base asset earning interest | baseAsset, balance, balanceUsd, apr |
compound-borrow | Base asset debt | baseAsset, debt, debtUsd, apr |
compound-collateral | Collateral backing borrows (no interest) | asset, balance, balanceUsd |
compound-reward | Unclaimed COMP rewards | rewardToken, 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