GetAccountLiquidity

Compound V2 Getter Plugin - GetAccountLiquidity

Description

Account Liquidity represents the USD value borrowable by a user, before it reaches liquidation. Users with a shortfall (negative liquidity) are subject to liquidation, and can’t withdraw or borrow assets until Account Liquidity is positive again.

Method

getUserAccountData(address)

Input Parameters

No required input parameters

Method Parameters

NamePlugin TypeDescription

account

FctAddress

The account whose liquidity shall be calculated

Returned Values

NamePlugin TypeDescription

liquidity

FctValue

A non-zero liquidity value indicates the account has available account liquidity

shortfall

FctValue

Shortfall value indicates the account is currently below his/her collateral requirement and is subject to liquidation.

Example

Example with initParams

const getAccountLiquidity = new CompoundV2.getter.GetAccountLiquidity({
   chainId: 1,
   initParams: {
     methodParams: {
       account: "0x...",
     }
   }
})

Example without initParams

const getAccountLiquidity = new CompoundV2.getter.GetAccountLiquidity({ chainId: 1 })

getAccountLiquidity.input.set({
    methodParams: {
       account: "0x...",
    }
})

Learn more

Learn more about Compound V2 get account liquidity method here

Last updated