Skip to content

API ReferenceLOC lifecycleFunction

assessLetterOfCreditRisk()

function assessLetterOfCreditRisk(
outstanding,
price,
pairConfiguration,
evaluatedAtTimestamp
): LetterOfCreditRiskAssessment;

Assesses V3 risk from explicitly sourced SDK price and current pair-configuration reads. Static and converted positions require neither input. The estimate mirrors the protocol’s value floor, fee floor and liquidation threshold; it is not an observed insolvency outcome.

Parameters

ParameterTypeDescription
outstandingLetterOfCreditHistoricalSnapshot & Pick<OutstandingLetterOfCredit, "beneficiary" | "creator" | "creationKind" | "reference">Current or indexed outstanding state being assessed.
priceTokenPairPrice | nullSDK pair-price read for this collateral-to-credited direction, or null when not applicable.
pairConfigurationCollateralFactor | nullCurrent SDK collateral-factor read for the same pair, or null when not applicable.
evaluatedAtTimestampbigintExplicit Unix-second evaluation clock. Price freshness policy belongs to the price read.

Returns

LetterOfCreditRiskAssessment

Health, liquidation coverage, source inputs and the assessed LOC identity.

Throws

InvalidArgumentError for missing, mismatched or unusable dynamic market inputs.

Example

const risk = assessLetterOfCreditRisk(outstanding, pairPrice, pairConfiguration, now);
// A projected shortfall does not write historical insolvency into the LOC.