BorrowBalance

Compound V2 Getter Plugin - BorrowBalance

Description

A user who borrows assets from the protocol is subject to accumulated interest based on the current borrow rate. Interest is accumulated every block and integrations may use this function to obtain the current value of a user’s borrow balance with interest.

Method

borrowBalanceCurrent(address)

Input Parameters

NamePlugin TypeDescription

to

FctAddress

cToken address

Method Parameters

NamePlugin TypeDescription

account

FctAddress

The account which borrowed the assets.

Returned Values

NamePlugin TypeDescription

borrowedAmount

FctValue

The user’s current borrow balance (with interest) in units of the underlying asset.

Example

Example with initParams

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

Example without initParams

const borrowBalance = new CompoundV2.getter.BorrowBalance({ chainId: 1 })

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

Learn more

Learn more about Compound V2 borrow balance method here

Last updated