Skip to main content

Lending

Operations → Lending (Composer)

Lead type: ComposerCommands.LENDING.

The sub types are defined by the following enum:

LenderOps Enum

ValueNameDescription
0DEPOSITDeposit collateral to lender
1BORROWBorrow from lender
2REPAYRepay to lender
3WITHDRAWWithdraw collateral from lender
4DEPOSIT_LENDING_TOKENDeposit lending token (e.g. for Morpho Blue)
5WITHDRAW_LENDING_TOKENWithdraw lending token (e.g. for Morpho Blue)

to the array of composer commands.

We encode lender types as follows:

LenderIds Enum

ValueNameDescription
1000UP_TO_AAVE_V3Aave V3 IDs: 0-999
2000UP_TO_AAVE_V2Aave V2 IDs: 1000-1999
3000UP_TO_COMPOUND_V3Compound V3 IDs: 2000-2999
4000UP_TO_COMPOUND_V2Compound V2 IDs: 3000-3999
5000UP_TO_MORPHOMorpho IDs: 4000-4999

To encode an operation, the caller has to append this data to the call.

abi.encodePacked(
uint8(ComposerCommands.LENDING),
uint8(LenderOps.[Operation]),
uint16(LenderIds.[Lender])
...params
)

Specific lenders