Compound API Guide

The pioneering algorithmic money market protocol

Build with Compound Protocol

Compound is one of the original DeFi lending protocols. Built by Compound Labs, it offers programmable interest rates and open financial infrastructure.

API Integration

// Using Compound.js SDK
const compound = require('@compound-finance/compound-js');

const cTokenAddress = '0x39AA39c719df9C5A4Ac15F9d4Aa0eA4d8e3f27e8'; // cETH
const underlying = await compound.getToken(cTokenAddress);

Key Features

Supply

  • Earn interest on deposits
  • Automatic interest accrual
  • cToken system

Borrow

  • Over-collateralized
  • Flexible amounts
  • Utilization-based rates

Governance

  • COMP token rewards
  • Community governed
  • Proposal system

Compound v2 vs v3

Compound v2

Original version with proven security. Good for ETH and basic assets.

Compound III

Updated with morpho-augmented pools, liquidation protection, and improved efficiency.