API ReferenceVaults, collateral, and riskFunction
getRequiredCollateralForDynamicLOC()
function getRequiredCollateralForDynamicLOC(ctx, params): Promise<bigint | undefined>;Calculates the required collateral for a dynamic LOC with the provided GetRequiredCollateralForDynamicLOCParams, using computeRequiredCollateral’s contract-verified estimate.
Missing factor and price inputs are fetched concurrently. An unconfigured pair or a zero creation
factor returns undefined even if its price read fails. A failed factor read takes precedence over
a failed price read; an enabled pair propagates its price-read error.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | SDKContext | The SDK context. |
params | GetRequiredCollateralForDynamicLOCParams | The parameters for collateral calculation. |
Returns
Promise<bigint | undefined>
The required collateral amount or undefined if there is no valid collateral amount for the parameters.