Function getMaxBorrowForBorrowUtilisationRatio

    • Returns the maximum borrow of a given asset considering a target borrow utilisation ratio. Returns 0 if cannot borrow anything more.

      Parameters

      • loan: UserLoanInfo

        user loan

      • assetPrice: bigint

        price of asset borrowing 14 d.p.

      • borrowFactor: bigint

        borrow factor of asset borrowing 4 d.p.

      • targetBorrowUtilisationRatio: bigint

        the utilisation ratio that you are targeting 4 d.p.

      Returns bigint

      bigint max asset amount