compoundtutorials
  • Chapter 1: Introduction to Compound
    • 1. What Is Compound?
    • 2. Introducing Comet (Compound V3)
    • 3. What’s Next?
  • Chapter 2: Markets, Utilization & Interest Rates
    • 1. What Is a Market in Comet?
    • 2. Utilization: Balancing Supply & Demand
    • 3. The Kink: A Flexible Threshold
    • 4. Interest Rate Parameters
    • 5. Supply and Borrow Interest Rates vs. Utilization Rate Chart
    • 6. Why This Matters
  • Chapter 3: Hands-On Tutorial (Step by Step)
    • 1. Environment Setup
    • 2. Getting Sepolia ETH and WETH
    • 3. Project Structure
    • 4. Creating the index.js Script
    • 5. Run the Script
    • 6. Next Steps
  • Chapter 4: Repaying, Withdrawing & Managing Your Position
    • 1. Updating index.js
    • 2. Example Usage in Your Main Execution
    • 3. Recap
    • 4. Summary & Best Practices
  • Chapter 5: Using the Compound.js SDK
    • Getting Started
    • Performing Common Actions
  • Chapter 6: Additional Resources
Powered by GitBook
On this page
  1. Chapter 5: Using the Compound.js SDK

Getting Started

Getting Started

Compound.js simplifies interaction with the protocol, making it developer-friendly. Here’s how to set it up and perform key actions:

  1. Install the Library:

    npm install @compound-finance/compound-js
  2. Set Up the SDK:

    const Compound = require('@compound-finance/compound-js');
    const compound = new Compound(window.ethereum); // Or use a custom RPC URL
    const comet = compound.comet.MAINNET_USDC(); 

NextPerforming Common Actions

PreviousChapter 5: Using the Compound.js SDKNextPerforming Common Actions

Last updated 5 months ago