API ReferenceVaults, collateral, and riskFunction
deriveCollateralAllocations()
function deriveCollateralAllocations(reservations): CollateralAllocation[];Groups active reservations by their actual reserving contract, account, asset and vault namespace. No non-pool or unknown contract is inferred to be a LOC.
Parameters
| Parameter | Type | Description |
|---|---|---|
reservations | readonly CollateralReservation[] | Named SDK reservation reads, normally the complete indexed collection. |
Returns
One token-denominated allocation per group. Inactive reservations do not contribute.
Throws
InvalidArgumentError if a full reservation identity occurs twice.
Example
const allocations = deriveCollateralAllocations(page.items);