Skip to content

API ReferenceValidationFunction

checkCollateralSufficiency()

function checkCollateralSufficiency(ctx, params): Promise<ValidationIssue[]>;

Checks whether the account has sufficient collateral (vault balance + optional wallet balance) for the requested amount, grossed up by the vault withdrawal fee only when params.appliesWithdrawalFee is true.

Also verifies the collateral token is enabled in the vault.

Parameters

ParameterType
ctxSDKContext
paramsCollateralCheckParams

Returns

Promise<ValidationIssue[]>