Skip to content

Compound V3 Integration#326

Open
BadGenius22 wants to merge 22 commits intoEmberAGI:mainfrom
BadGenius22:compoundv3-plugin
Open

Compound V3 Integration#326
BadGenius22 wants to merge 22 commits intoEmberAGI:mainfrom
BadGenius22:compoundv3-plugin

Conversation

@BadGenius22
Copy link

@BadGenius22 BadGenius22 commented Nov 22, 2025

Summary

Related Issue(s):
To prevent duplicate work and to ensure that your contribution aligns with Vibekit's architecture, please create an issue before submitting a PR.

Provide a brief description of what this PR accomplishes:

Type of Change:

  • 🐛 Bug fix (fixes an issue)
  • ✨ New feature (adds functionality)
  • 🔌 Protocol integration (adds support for new DeFi protocol)
  • 🤖 Agent template (new agent template)
  • 🔧 MCP server (new MCP integration)
  • 📚 Documentation (updates to docs)
  • 🔄 Refactor (code improvements, no functional changes)
  • 🧪 Tests (adding or updating tests)
  • ⚙️ Tooling/CI (build process, development tools)

🧪 Testing

🏃 Running Tests

The plugin includes comprehensive test coverage with both unit and integration tests.

✅ Run All Tests

cd typescript/onchain-actions-plugins/registry
pnpm test

🧩 Run Unit Tests Only

pnpm test:unit

🔗 Run Integration Tests Only

pnpm test:int

🐛 Run Integration Tests with Debug Logging

pnpm test:int:debug

📁 Test Structure

tests/compound-lending-plugin/
├── integration/
│   ├── adapter.transaction.int.test.ts    # Transaction method tests
│   └── compound-lending-plugin/
│       └── adapter.int.test.ts            # Position query tests
└── unit/
    └── compound-lending-plugin/
        ├── error.unit.test.ts             # Error handling tests
        ├── market.unit.test.ts            # Market resolution tests
        └── userSummary.unit.test.ts       # User summary tests

⚙️ Integration Test Requirements

Integration tests require:

  1. 🌐 RPC URL: Set ARBITRUM_ONE_RPC_URL in .env.test or use default public RPC
  2. 💼 Test Wallet: For transaction tests, Anvil fork is recommended
  3. 🔢 Block Number (optional): Set TEST_BLOCK_NUMBER for deterministic testing

Example .env.test:

ARBITRUM_ONE_RPC_URL=https://arb1.arbitrum.io/rpc
TEST_BLOCK_NUMBER=12345678

🎯 Running Specific Tests

# Run a specific test file
pnpm test:int tests/compound-lending-plugin/integration/adapter.transaction.int.test.ts

# Run tests matching a pattern
pnpm test:int tests/*transaction*.int.test.ts

# Run specific test by name
pnpm test:int -t "should calculate LTV correctly"

Checklists

Code Quality

  • Code follows project conventions and style guidelines
  • TypeScript compilation passes (pnpm build)
  • Linting passes (pnpm lint)
  • All tests pass (pnpm test)
  • No any types introduced
  • Error handling implemented appropriately
  • Security best practices followed (no exposed secrets/keys)

Documentation

  • Code is self-documenting or includes necessary comments
  • README updated if applicable
  • API/interface changes documented
  • Breaking changes noted in description

Closes #304

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[New Plugin Integration]: Compound v3 Integration

1 participant