IsBorrowCollateralized

Compound V3 Getter Plugin - IsBorrowCollateralized

Description

This function returns true if the account passed to it has non-negative liquidity based on the borrow collateral factors. This function returns false if an account does not have sufficient liquidity to increase its borrow position. A return value of false does not necessarily imply that the account is presently liquidatable.

Method

isBorrowCollateralized(address)

Input Parameters

NamePlugin TypeDescription

to

FctAddress

Comet address

Method Parameters

NamePlugin TypeDescription

account

FctAddress

The account to examine collateralization.

Returned Values

NamePlugin TypeDescription

hasEnoughLiquidity

FctBoolean

Returns true if the account has enough liquidity for borrowing.

Example

Example with initParams

const isBorrowCollateralized = new CompoundV3.getter.IsBorrowCollateralized({
   chainId: 1,
   initParams: {
     to: "0xc3d688B66703497DAA19211EEdff47f25384cdc3", // cUSDCv3
     methodParams: {
       account: "0x...",
     }
   }
})

Example without initParams

const isBorrowCollateralized = new CompoundV3.getter.IsBorrowCollateralized({ chainId: 1 })

isBorrowCollateralized.input.set({
    to: "0xc3d688B66703497DAA19211EEdff47f25384cdc3", // cUSDCv3
    methodParams: {
      account: "0x...",
    }
})

Learn more

Learn more about Compound V3 Borrow Collateralization method here

Last updated