API ReferenceVaults, collateral, and riskFunction
getCollateralTokensForCreditedToken()
function getCollateralTokensForCreditedToken( ctx, params, subgraphUrl, options?): Promise<CollectionPage<CollateralToken>>;Fetches the CollateralTokens eligible as collateral for the given credited token.
A collateral token is eligible when it is non-disabled AND either:
- It IS the credited token (the static-LOC case, where a token collateralizes itself and no AssetPair/CollateralFactor is required), or
- It has a non-disabled
AssetPairAND a non-disabledCollateralFactorwithcreationCollateralFactorBasisPoints > 0for the credited token.
This is a dedicated action (not a creditedToken filter on
getCollateralTokens) because the eligibility join is a materially
different query shape from the general listing action.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | SDKContext | The SDK context. |
params | GetCollateralTokensForCreditedTokenParams | The request-specific parameters, including the credited token to find eligible collateral tokens for. |
subgraphUrl | string | The URL of the subgraph endpoint. |
options | ReadExecutionOptions | Cancellation controls kept separate from collection filters. |
Returns
Promise<CollectionPage<CollateralToken>>
The collateral tokens eligible for the specified credited token.