API ReferenceReact provider and hooksInterface
UseRiskFactorParams
Inputs to useRiskFactor. All fields are optional so the hook can be mounted before a form is complete; it computes only once every input it needs is present.
Remarks
collateralToken and creditedToken together select the oracle pair price (see
useTokenPairPrice) and the pair’s configured collateral factors
(sdk.loc.getCollateralFactor). Leave either token unset to pause the hook — nothing is fetched
and the result reads incomplete. A completed lookup for an unsupported pair returns a null
collateral factor so callers can distinguish absence from idle state.
Properties
basis?
optional basis?: CollateralFactorBasis;Which configured factor to score against. Defaults to liquidation; pass creation for a preview
of a LOC that does not exist yet.
collateralAmount?
optional collateralAmount?: bigint;Collateral the creator has locked (or is about to lock) for this dynamic LOC, in the collateral
token’s smallest unit. Together with creditedAmount and the live pair price this fixes the
position’s current collateral factor; the result stays incomplete until both amounts are positive.
collateralToken?
optional collateralToken?: `0x${string}`;ERC-20 the LOC is collateralized in. With creditedToken it selects the oracle pair price and the
pair’s configured collateral factors.
creditedAmount?
optional creditedAmount?: bigint;Amount the LOC promises the beneficiary, in the credited token’s smallest unit. The denominator of the collateral factor: more credit against the same collateral means a higher risk factor.
creditedToken?
optional creditedToken?: `0x${string}`;ERC-20 the LOC credits to the beneficiary. Must differ from collateralToken: a static LOC (same
token both sides) has no oracle price and no risk factor.