Supply

Compound V3 Action Plugin - Supply

Description

The supply function transfers an asset to the protocol and adds it to the account’s balance. This function can be used to supply collateral, supply the base asset, or repay an open borrow of the base asset.

Method

supply(address, uint256)

Input Parameters

NamePlugin TypeDescription

to

FctAddress

Comet address

Method Parameters

NamePlugin TypeDescription

asset

FctAddress

The address of the asset’s smart contract.

amount

FctValue

The amount of the asset to supply to Compound III expressed as an integer.

Returned Values

No returned values

Example

Example with initParams

const supply = new CompoundV3.actions.Supply({
   chainId: 1,
   initParams: {
     to: "0xc3d688B66703497DAA19211EEdff47f25384cdc3", // cUSDCv3
     methodParams: {
       asset: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
       amount: "10000000"
     }
   }
})

Example without initParams

const supply = new CompoundV3.actions.Supply({ chainId: 1 })

supply.input.set({
   to: "0xc3d688B66703497DAA19211EEdff47f25384cdc3", // cUSDCv3
   methodParams: {
     asset: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
     amount: "10000000"
   }
})

Learn more

Learn more about Compound V3 supply method here

Last updated