Show / Hide Table of Contents

Class LoanOrigination

The terms of a loan before LoanSet, computed offline from the transaction and the vault and broker entries, the way rippled's LoanSet and computeLoanProperties compute them.

Inheritance
object
LoanOrigination
Namespace: Xrpl.Sugar
Assembly: Xrpl.dll
Syntax
public static class LoanOrigination
Remarks

The result feeds Project(LOLoan, IssuedCurrency, ushort, LedgerRules) directly, so a loan's full schedule is known before anyone signs, without a node. PreviewLoanSet(IXrplClient, LoanSet, CancellationToken) asks the node instead and covers every check.

Repeated here are the checks that depend on the amounts: the vault's available assets (tecINSUFFICIENT_FUNDS), a value the asset cannot hold or that has more precision than the loan's scale, and the amortization guards (tecPRECISION_LOSS). The transaction's own validation, the vault's and broker's limits and cover, reserves and authorization are not.

Methods

| Edit this page View Source

Compute(LoanSet, LOVault, LOLoanBroker, DateTime?, LedgerRules)

Computes what loanSet would create.

Declaration
public static LoanOriginationTerms Compute(LoanSet loanSet, LOVault vault, LOLoanBroker broker, DateTime? startDate = null, LedgerRules options = null)
Parameters
Type Name Description
LoanSet loanSet

The transaction: PrincipalRequested, the rates, fees and schedule.

LOVault vault

The broker's vault, which gives the asset and the scale of its AssetsTotal.

LOLoanBroker broker

The LoanBroker, which gives the management fee rate.

Nullable startDate

The close time of the ledger the loan would be created in, which sets StartDate and the first due date; null leaves both unset.

LedgerRules options

The amendments in force; the current rules when null.

Returns
Type Description
LoanOriginationTerms
Exceptions
Type Condition
ArgumentException

The transaction carries no PrincipalRequested, or the vault no asset.

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX