Skip to Content

Compound V3 action reference

This page is generated from the plugin registry. Do not edit it by hand.

Compound V3 (Comet) lending protocol: supply assets, borrow base tokens, and monitor balances across isolated markets

For guidance and examples see the Compound V3 guide.

Set actionType in a node’s config to the action type shown under each heading. See the workflow definition page for the node format.

Read actions return the value under result: a single unnamed output is result, a named one is result.<name>, and several outputs are result.<name> each. Reference it as {{@nodeId:Label.result}}. Integer Solidity types are passed as decimal strings.

ActionAction type
Compound V3: Supply Assetcompound/supply
Compound V3: Withdraw Assetcompound/withdraw
Compound V3: Get Base Balancecompound/get-balance
Compound V3: Get Collateral Balancecompound/get-collateral-balance
Compound V3: Get Borrow Balancecompound/get-borrow-balance
Compound V3: Get Utilizationcompound/get-utilization
Compound V3: Get Supply Ratecompound/get-supply-rate
Compound V3: Get Borrow Ratecompound/get-borrow-rate
Compound V3: Get Total Supplycompound/get-total-supply
Compound V3: Get Total Borrowcompound/get-total-borrow
Compound V3: Is Liquidatablecompound/is-liquidatable
Compound V3: Get Number of Assetscompound/get-num-assets

Compound V3: Supply Asset

Action type: compound/supply. Connection: required (web3).

Supply base or collateral assets to a Compound V3 Comet market. Requires prior ERC-20 approval for the Comet contract.

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
networkstringYeschain ids 1, 8453, 42161Network.
sendModestringNotransaction, private-relaySend as. How the transaction goes out. “transaction” (the default) sends it to the public mempool. “private-relay” sends it through the network’s private relay (Flashbots Protect on Ethereum), only on networks that have one, and is never gas-sponsored. A config with usePrivateMempool: true and no sendMode uses the private relay where the network has one and the public mempool elsewhere, never sponsored.
contractAddressstringYesComet Market Address.
assetaddressYesAsset Token Address (address).
amountuint256YesAmount (wei) (uint256).
gasLimitMultiplierstringNoGas Limit.
sponsorGasbooleanNotrueSponsor gas. When on, the transaction goes through gas sponsorship first and falls back to your own wallet if sponsorship is unavailable on this network or your credits are spent. Turn it off to always pay gas from your own wallet. Sponsorship is never used when Send as is not Normal transaction or the node signs through a Safe, and on Write Contract when Simulate at is set to Next block. Shown when the network supports gas sponsorship.

Outputs

OutputDescription
successWhether the operation succeeded
errorError message if the operation failed
transactionHashTransaction hash
transactionLinkExplorer link to transaction
routeHow KeeperHub routed the send on an EVM network: public (the public mempool, through your RPC or the chain’s default RPC), private-relay (accepted by the private relay chosen in Send as), sponsored (gas-sponsored), bundle (Write Contract sent as a bundle to block builders), bundle-and-public (sent as a bundle and to the public mempool), skipped-in-flight (Write Contract with Send as Bundle sent nothing because this workflow’s earlier bundle could still land, or an earlier run’s public copy is not mined yet: KeeperHub checks it every few minutes and stops waiting after a day) or waiting (Write Contract with Send as Bundle sent nothing because its Not before time is still too far ahead, Max Fee held back the targets ahead, or KeeperHub had paused bundle sends, with paused true, or could not check whether they are on, with switchUnread true). Through a Safe, the route of the transaction your wallet sent to the Safe. Absent when nothing was sent (except skipped-in-flight and waiting), or when only the private relay was tried and it never confirmed taking the transaction; more values may be added.
includedTrue when the transaction was seen in a block (one confirmation, not final); it may have reverted, so check error too. False when it was sent but is not in a block, and on a skipped-in-flight or waiting bundle step (a paused one included). Absent when route is absent.

Compound V3: Withdraw Asset

Action type: compound/withdraw. Connection: required (web3).

Withdraw base or collateral assets from a Compound V3 Comet market

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
networkstringYeschain ids 1, 8453, 42161Network.
sendModestringNotransaction, private-relaySend as. How the transaction goes out. “transaction” (the default) sends it to the public mempool. “private-relay” sends it through the network’s private relay (Flashbots Protect on Ethereum), only on networks that have one, and is never gas-sponsored. A config with usePrivateMempool: true and no sendMode uses the private relay where the network has one and the public mempool elsewhere, never sponsored.
contractAddressstringYesComet Market Address.
assetaddressYesAsset Token Address (address).
amountuint256YesAmount (wei) (uint256).
gasLimitMultiplierstringNoGas Limit.
sponsorGasbooleanNotrueSponsor gas. When on, the transaction goes through gas sponsorship first and falls back to your own wallet if sponsorship is unavailable on this network or your credits are spent. Turn it off to always pay gas from your own wallet. Sponsorship is never used when Send as is not Normal transaction or the node signs through a Safe, and on Write Contract when Simulate at is set to Next block. Shown when the network supports gas sponsorship.

Outputs

OutputDescription
successWhether the operation succeeded
errorError message if the operation failed
transactionHashTransaction hash
transactionLinkExplorer link to transaction
routeHow KeeperHub routed the send on an EVM network: public (the public mempool, through your RPC or the chain’s default RPC), private-relay (accepted by the private relay chosen in Send as), sponsored (gas-sponsored), bundle (Write Contract sent as a bundle to block builders), bundle-and-public (sent as a bundle and to the public mempool), skipped-in-flight (Write Contract with Send as Bundle sent nothing because this workflow’s earlier bundle could still land, or an earlier run’s public copy is not mined yet: KeeperHub checks it every few minutes and stops waiting after a day) or waiting (Write Contract with Send as Bundle sent nothing because its Not before time is still too far ahead, Max Fee held back the targets ahead, or KeeperHub had paused bundle sends, with paused true, or could not check whether they are on, with switchUnread true). Through a Safe, the route of the transaction your wallet sent to the Safe. Absent when nothing was sent (except skipped-in-flight and waiting), or when only the private relay was tried and it never confirmed taking the transaction; more values may be added.
includedTrue when the transaction was seen in a block (one confirmation, not final); it may have reverted, so check error too. False when it was sent but is not in a block, and on a skipped-in-flight or waiting bundle step (a paused one included). Absent when route is absent.

Compound V3: Get Base Balance

Action type: compound/get-balance. Connection: not required.

Get the balance of the base asset (e.g. USDC) for an account in a Comet market

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
networkstringYeschain ids 1, 8453, 42161Network.
contractAddressstringYesComet Market Address.
accountaddressYesAccount Address (address).

Outputs

OutputDescription
resultBase Asset Balance
successWhether the operation succeeded
errorError message if the operation failed

Compound V3: Get Collateral Balance

Action type: compound/get-collateral-balance. Connection: not required.

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

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
networkstringYeschain ids 1, 8453, 42161Network.
contractAddressstringYesComet Market Address.
accountaddressYesAccount Address (address).
assetaddressYesCollateral Asset Address (address).

Outputs

OutputDescription
resultThe contract function return value
result.balanceCollateral Balance
successWhether the operation succeeded
errorError message if the operation failed

Compound V3: Get Borrow Balance

Action type: compound/get-borrow-balance. Connection: not required.

Get the borrow balance of the base asset for an account in a Comet market

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
networkstringYeschain ids 1, 8453, 42161Network.
contractAddressstringYesComet Market Address.
accountaddressYesAccount Address (address).

Outputs

OutputDescription
resultBorrow Balance
successWhether the operation succeeded
errorError message if the operation failed

Compound V3: Get Utilization

Action type: compound/get-utilization. Connection: not required.

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

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
networkstringYeschain ids 1, 8453, 42161Network.
contractAddressstringYesComet Market Address.

Outputs

OutputDescription
resultUtilization Rate
successWhether the operation succeeded
errorError message if the operation failed

Compound V3: Get Supply Rate

Action type: compound/get-supply-rate. Connection: not required.

Get the per-second supply rate for a given utilization level. Multiply by seconds in a year (31536000) for APR.

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
networkstringYeschain ids 1, 8453, 42161Network.
contractAddressstringYesComet Market Address.
utilizationuint256YesUtilization (from Get Utilization) (uint256).

Outputs

OutputDescription
resultSupply Rate Per Second
successWhether the operation succeeded
errorError message if the operation failed

Compound V3: Get Borrow Rate

Action type: compound/get-borrow-rate. Connection: not required.

Get the per-second borrow rate for a given utilization level. Multiply by seconds in a year (31536000) for APR.

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
networkstringYeschain ids 1, 8453, 42161Network.
contractAddressstringYesComet Market Address.
utilizationuint256YesUtilization (from Get Utilization) (uint256).

Outputs

OutputDescription
resultBorrow Rate Per Second
successWhether the operation succeeded
errorError message if the operation failed

Compound V3: Get Total Supply

Action type: compound/get-total-supply. Connection: not required.

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

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
networkstringYeschain ids 1, 8453, 42161Network.
contractAddressstringYesComet Market Address.

Outputs

OutputDescription
resultTotal Supply
successWhether the operation succeeded
errorError message if the operation failed

Compound V3: Get Total Borrow

Action type: compound/get-total-borrow. Connection: not required.

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

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
networkstringYeschain ids 1, 8453, 42161Network.
contractAddressstringYesComet Market Address.

Outputs

OutputDescription
resultTotal Borrow
successWhether the operation succeeded
errorError message if the operation failed

Compound V3: Is Liquidatable

Action type: compound/is-liquidatable. Connection: not required.

Check if an account is currently liquidatable in a Comet market

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
networkstringYeschain ids 1, 8453, 42161Network.
contractAddressstringYesComet Market Address.
accountaddressYesAccount Address (address).

Outputs

OutputDescription
resultIs Liquidatable
successWhether the operation succeeded
errorError message if the operation failed

Compound V3: Get Number of Assets

Action type: compound/get-num-assets. Connection: not required.

Get the number of collateral assets supported by a Comet market

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
networkstringYeschain ids 1, 8453, 42161Network.
contractAddressstringYesComet Market Address.

Outputs

OutputDescription
resultNumber of Collateral Assets
successWhether the operation succeeded
errorError message if the operation failed

Contracts

ContractChain ids
Comet Marketany (the address is set on the node)