Lend and Borrow

Provides connectivity across the various Lend and Borrow protocols available on the EVM and Non-EVM chains.

Following are the common functions implemented for all the Lend and Borrow protocols:-

NameTypeDescription

getpool

Read

Get the lend and borrow APY for the given pool from the given protocol.

getpools

Read

Get the list of supply and borrow APYs of the mentioned assets.

getuseraccountdata

Read

Get the repay, borrow, and withdraw amount details for the given user.

entermarketstatus

Read

Check whether the user is approved before deposting.

getassetinfo

Read

Get the details of a specified asset like liquidation and borrow collateral factor, index and the price feed address. Available for Compound V3.

getclaimedrewards

Read

Get the rewards claimed by the specified account on the protocol. Available for Compound V3.

getmaxamounts

Read

Get the max withdrawable amount and the max borrowable amount of the base token for a given asset in the protocol for the specified account. Available for Compound V3.

getgovernordata

Read

Get the protocol and governor-related data for a market. Available for Compound V3.

allow

Write

Trigger a transaction on Compound V3 to allow or disallow the specified address to withdraw or transfer on behalf of the sender’s address.

claimrewards

Write

Trigger a transaction on Compound V3 to allow an account to claim rewards from the protocol.

deposit

Write

Trigger the deposit transaction from the given protocol.

transfer

Write

Trigger a transaction on Compound V3 to transfer an asset within the protocol to another account.

bundleactions

Write

Trigger a transaction on Compound V3 to pass an array of action codes and data w.r.t the action codes that are executed, one by one, in a single transaction.

borrow

Write

Trigger the borrow transaction from the given protocol. Borrows the base token from specified market in case of Compound V3.

liquidate

Write

Trigger the liquidate transaction from the given protocol.

repay

Write

Trigger the repay transaction from the given protocol.

withdraw

Write

Trigger the withdrawal transaction from the given protocol.

migrate

Write

Trigger the migrate transaction for Aave v3.

setuseremode

Write

Trigger the E-Mode options for the user, on Aave v3.

exitisolationmode

Write

Trigger the exit of isolation mode options for the user, on Aave v3.

entermarket

Write

Trigger the approve transaction as Compound needs the user to approve before they can start deposit.

exitmarket

Write

Trigger the exit market transaction for Compound.

Every protocol requires a different set of parameters to perform the common operations. Please refer to the sub-sections for details.

Following is a sequence diagram for deposit() process in Compound:-

Following is a sequence diagram for deposit() process in Aave:-

Following is a sequence diagram for borrow() process:-

Following is a sequence diagram for liquidate() process:-

Following is a sequence diagram for repay() process:-

Following is a sequence diagram for withdraw() process:-

Last updated