Skip to Content
PluginsCompound V3

Compound V3

Compound V3 (Comet) is a decentralized lending protocol with isolated markets. Each Comet market has a single borrowable base asset (e.g. USDC) and multiple collateral assets. Users supply collateral to borrow the base asset, or supply the base asset to earn interest. This plugin provides actions for core lending operations and balance monitoring.

Supported chains: Ethereum, Base, Arbitrum. Each Comet market is a separate contract — you specify the market address when configuring actions. Read-only actions work without credentials. Write actions require a connected wallet.

Comet Market Addresses

Each Comet market is a standalone contract. Common markets:

ChainBase AssetComet Address
Ethereum (1)USDC0xc3d688B66703497DAA19211EEdff47f25384cdc3
Ethereum (1)USDT0x3Afdc9BCA9213A35503b077a6072F3D0d5AB0840
Ethereum (1)WETH0xA17581A9E3356d9A858b789D68B4d866e593aE94
Base (8453)USDC0xb125E6687d4313864e53df431d5425969c15Eb2F
Base (8453)USDbC0x9c4ec768c28520B50860ea7a15bd7213a9fF58bf
Base (8453)WETH0x46e6b214b524310239732D51387075E0e70970bf
Arbitrum (42161)USDC0x9c4ec768c28520B50860ea7a15bd7213a9fF58bf
Arbitrum (42161)USDT0xd98Be00b5D27fc98112BdE293e487f8D4cA57d07
Arbitrum (42161)WETH0x6f7D514bbD4aFf3BcD1140B7344b32f063dEe486

Actions

ActionTypeCredentialsDescription
Supply AssetWriteWalletSupply base or collateral assets to a Comet market
Withdraw AssetWriteWalletWithdraw base or collateral assets from a Comet market
Get Base BalanceReadNoGet the base asset balance for an account
Get Collateral BalanceReadNoGet a collateral asset balance for an account
Get Borrow BalanceReadNoGet the borrow balance for an account
Get UtilizationReadNoGet the current utilization rate of a market
Get Supply RateReadNoGet the per-second supply rate for a utilization level
Get Borrow RateReadNoGet the per-second borrow rate for a utilization level
Get Total SupplyReadNoGet total base asset supplied across all users
Get Total BorrowReadNoGet total base asset borrowed across all users
Is LiquidatableReadNoCheck if an account is currently liquidatable
Get Number of AssetsReadNoGet the number of supported collateral assets

Supply Asset

Supply base or collateral assets to a Compound V3 Comet market. Requires prior ERC-20 approval for the Comet contract. Supplying the base asset earns interest. Supplying a collateral asset enables borrowing.

Inputs:

InputTypeDescription
assetaddressAsset Token Address
amountuint256Amount (wei)

Outputs: success, transactionHash, transactionLink, error

When to use: Earn yield on stablecoins, deposit collateral before borrowing, automate deposits when conditions are met.


Withdraw Asset

Withdraw base or collateral assets from a Compound V3 Comet market. Ensure withdrawing collateral does not make the position liquidatable.

Inputs:

InputTypeDescription
assetaddressAsset Token Address
amountuint256Amount (wei)

Outputs: success, transactionHash, transactionLink, error

When to use: Withdraw funds when needed, reduce collateral exposure, automate withdrawals based on rate changes.


Get Base Balance

Get the balance of the base asset (e.g. USDC) for an account in a Comet market. Returns the current lending balance including accrued interest.

Inputs:

InputTypeDescription
accountaddressAccount Address

Outputs:

OutputTypeDescription
balanceuint256Base Asset Balance (raw, decimals vary by market)

When to use: Monitor supply positions, check earned interest, trigger actions based on balance thresholds.


Get Collateral Balance

Get the collateral balance of a specific asset for an account in a Comet market.

Inputs:

InputTypeDescription
accountaddressAccount Address
assetaddressCollateral Asset Address

Outputs:

OutputTypeDescription
balanceuint256Collateral Balance

When to use: Monitor collateral positions, check if collateral needs topping up, track portfolio exposure.


Get Borrow Balance

Get the borrow balance of the base asset for an account in a Comet market. Returns the current outstanding debt including accrued interest.

Inputs:

InputTypeDescription
accountaddressAccount Address

Outputs:

OutputTypeDescription
balanceuint256Borrow Balance (raw, decimals vary by market)

When to use: Monitor outstanding debt, trigger repayment workflows, track borrowing costs.


Get Utilization

Get the current utilization rate of a Comet market (ratio of borrows to supply, scaled to 1e18).

Inputs: None

Outputs:

OutputTypeDescription
utilizationuint256Utilization Rate (18 decimals)

When to use: Monitor market health, feed into supply/borrow rate calculations, trigger actions when utilization crosses a threshold.


Get Supply Rate

Get the per-second supply rate for a given utilization level. Multiply by 31536000 for annualized APR.

Inputs:

InputTypeDescription
utilizationuint256Utilization (from Get Utilization)

Outputs:

OutputTypeDescription
rateuint64Supply Rate Per Second

When to use: Compare yield across markets, trigger rebalancing when rates change, monitor APR trends.


Get Borrow Rate

Get the per-second borrow rate for a given utilization level. Multiply by 31536000 for annualized APR.

Inputs:

InputTypeDescription
utilizationuint256Utilization (from Get Utilization)

Outputs:

OutputTypeDescription
rateuint64Borrow Rate Per Second

When to use: Monitor borrowing costs, trigger repayment when rates spike, compare across markets.


Get Total Supply

Get the total base asset supplied to a Comet market across all users.

Inputs: None

Outputs:

OutputTypeDescription
totalSupplyuint256Total Supply (raw, decimals vary by market)

When to use: Monitor market depth, detect large supply changes, assess market liquidity.


Get Total Borrow

Get the total base asset borrowed from a Comet market across all users.

Inputs: None

Outputs:

OutputTypeDescription
totalBorrowuint256Total Borrow (raw, decimals vary by market)

When to use: Monitor market demand, detect borrow spikes, assess protocol risk.


Is Liquidatable

Check if an account is currently liquidatable in a Comet market.

Inputs:

InputTypeDescription
accountaddressAccount Address

Outputs:

OutputTypeDescription
isLiquidatableboolIs Liquidatable

When to use: Monitor position health, trigger alerts before liquidation, build liquidation bots.


Get Number of Assets

Get the number of collateral assets supported by a Comet market.

Inputs: None

Outputs:

OutputTypeDescription
numAssetsuint8Number of Collateral Assets

When to use: Enumerate supported collaterals, detect new asset additions.


Example Workflows

Supply Balance Monitor

Schedule (every hour) -> Compound V3: Get Base Balance -> Condition (balance < threshold) -> Discord: Send Message

Monitor your supply balance in a Comet market and alert when it drops below a threshold, which could indicate unexpected withdrawals or liquidation.

Borrow Position Monitor

Schedule (every 5 min) -> Compound V3: Get Borrow Balance -> Code (format balance) -> Condition (balance > limit) -> Discord: Send Message

Track your borrow balance and get notified when outstanding debt exceeds a limit, giving you time to repay before the position becomes risky.

Auto-Supply on Deposit

Webhook (receive deposit notification) -> Compound V3: Supply Asset

Automatically supply received assets to a Comet market to start earning interest immediately.


Supported Chains

ChainContracts Available
Ethereum (1)Comet (user-specified market address)
Base (8453)Comet (user-specified market address)
Arbitrum (42161)Comet (user-specified market address)

Each Comet market is a separate contract. You specify the market address when configuring actions. See the Comet Market Addresses table above for common market contracts.