Implementation and Integration Patterns
Documents integration patterns for Compound markets, including cToken and Comet contract interfaces, event monitoring strategies, liquidation bot architectures, and institutional custody workflows. Covers API changes, subgraph indexing requirements, and composability patterns with other DeFi protocols. Wallet providers, exchange operations teams, and DeFi aggregators use this group to ensure reliable transaction construction, accurate position tracking, and efficient liquidation participation.
Comet (Compound III) Contract Interface and Integration Guide
Definitive integration reference for the current Compound III (Comet) architecture. Covers the single-asset borrowing model, supply/withdraw/borrow/repay flows via a single contract, and multi-collateral management. Affects wallet providers, custodians, and DeFi aggregators building new integrations. Chainscore can provide an integration readiness review to ensure correct implementation of the fundamentally different Comet model versus legacy cToken patterns.
cToken Contract Interface and Integration Guide
Canonical reference for integrating with the legacy Compound II (cToken) architecture. Covers the ERC-20 wrapping pattern, non-rebasing exchange rate mechanics, and precise methods for mint, redeem, borrow, and repay. Essential for wallets, custodians, and aggregators still supporting legacy Compound markets. Chainscore can audit existing integrations for accurate balance tracking and transaction construction against this deprecated but still-active standard.
Migration Patterns: Compound II to Compound III
Practical guide for integrators managing the user-facing transition from cToken markets to Comet deployments. Covers contract address mapping, withdrawal and re-supply flows, and accounting reconciliation between the two systems. Affects exchanges, wallets, and data providers maintaining accurate user position history. Chainscore can support migration planning and review off-chain accounting logic for consistency.
Liquidation Engine Architecture and Bot Strategies
Technical deep dive into building reliable liquidation bots for both cToken and Comet markets. Covers the `absorb` function in Comet, `liquidateBorrow` in cToken, profit calculation formulas, gas optimization, and mempool monitoring strategies. Affects searchers, market makers, and risk teams. Chainscore can review bot logic for economic soundness and gas efficiency under volatile conditions.
Event Monitoring and Indexing for Compound Markets
Authoritative guide for tracking on-chain state changes to build a complete position ledger. Specifies canonical events (Supply, Withdraw, SupplyCollateral, TransferCollateral, AbsorbCollateral), event signature hashes, parameter decoding, and reorg handling strategies. Affects data teams building subgraphs, dashboards, and back-end systems. Chainscore can validate indexing logic against mainnet and testnet event histories.
Accurate Position Tracking and Balance Calculation
Definitive methodology for calculating real-time user health and net positions off-chain. Covers tracking `borrowIndex` and `supplyIndex` (cToken) or `totalSupply`/`totalBorrow` (Comet) to compute accrued interest without per-block RPC calls. Essential for wallets and dashboards displaying correct balances. Chainscore can audit off-chain position engines for interest accrual accuracy.
Institutional Custody and Exchange Integration Workflows
Guide for centralized exchanges and qualified custodians integrating Compound yield. Covers secure key management for supply/withdraw operations, use of permit and delegate functions for gasless transactions, and internal reconciliation of principal versus yield. Affects exchange operations and compliance teams. Chainscore can provide custody integration review and reconciliation process validation.
Comet Reward Token Claiming and Distribution Logic
Technical reference on the `CometRewards` contract architecture. Covers off-chain reward accrual tracking, multi-user claiming mechanics, and integration patterns for abstracting the claiming process from end-users. Addresses complexities of merkle-proof-based distributions. Affects protocols and services managing reward programs. Chainscore can review claiming integration for correctness and gas efficiency.
Price Oracle Integration and Feed Validation
Guide for integrators interacting with Compound's price oracle contracts. Covers the `getPrice` interface, Open Price Feed (OPF) architecture, reporter network dynamics, and validation of price staleness and accuracy before use in liquidations or risk checks. Affects liquidation bot operators, risk dashboards, and DeFi protocols building on Compound. Chainscore can assess oracle dependency risks and feed validation logic.
Composable DeFi Patterns: Building on Compound
Cookbook of integration patterns for protocols building on Compound markets. Covers leveraged yield farming strategies, structured products using cTokens or Comet positions as collateral, and vault integrations. Focuses on safe composability, reentrancy guards, and supply cap handling. Affects DeFi protocol architects and vault strategists. Chainscore can review composability patterns for security and economic risks.
API and SDK Changes for Protocol Upgrades
Changelog-style reference tracking the evolution of client libraries and APIs for Compound interaction. Covers breaking changes in contract ABIs, new helper functions in community SDKs, and deprecation of legacy endpoints. Critical for developers maintaining application compatibility. Chainscore can assist teams in assessing upgrade impact on their integration surface.
Cross-Chain Deployment Integration Patterns
Guide for integrating with Compound's deployments across Ethereum, Polygon, Arbitrum, and other networks. Covers chain-specific contract addresses, oracle implementation differences, governance bridge assumptions, and strategies for unified multi-chain position management. Affects multi-chain wallets, dashboards, and aggregators. Chainscore can review cross-chain integration architecture for consistency and risk.
Transaction Construction and Gas Optimization
Practical guide for building robust Compound transactions. Covers precise encoding of complex operations, gas limit estimation for variable-cost functions like `absorb`, and EIP-1559 fee mechanics for timely inclusion during volatility. Affects bot operators, wallets, and any system submitting transactions. Chainscore can audit transaction construction logic for reliability under network congestion.
Pause Guardian and Protocol Freeze Integration Handling
Guide for integrators on detecting and gracefully handling protocol pauses. Covers events to monitor for supply, borrow, and liquidation pauses, and recommended UI/UX patterns for informing users and disabling functionality without causing transaction failures. Affects front-end teams, wallets, and aggregators. Chainscore can review pause-handling logic as part of an integration resilience assessment.
Subgraph Indexing Requirements and Performance Patterns
Guide for data teams building or querying subgraphs for Compound data. Covers schema design for user positions, market state, and historical APY queries. Addresses performance pitfalls from high-volume `AccrueInterest` events and indexing strategies for large-scale analytics. Affects data engineers and analytics teams. Chainscore can review subgraph architectures for indexing efficiency and query performance.