Asset Tokenization Studio Team
ILoansPortfolio
External interface for the loans-portfolio facet: registration of holdings, withdrawals and read-only metrics over the portfolio composition.
Methods
addHoldingsAsset
function addHoldingsAsset(ILoansPortfolio.HoldingsAsset _holdingsAsset) external nonpayable returns (bool success_)
Parameters
| Name | Type | Description |
|---|
| _holdingsAsset | ILoansPortfolio.HoldingsAsset | undefined |
Returns
| Name | Type | Description |
|---|
| success_ | bool | undefined |
getDefaultedLoansRatio
function getDefaultedLoansRatio() external view returns (uint256 numerator_, uint256 denominator_)
Returns the defaulted-loans ratio as a numerator/denominator pair.
Returns
| Name | Type | Description |
|---|
| numerator_ | uint256 | Numerator of the defaulted-loans ratio. |
| denominator_ | uint256 | Denominator of the defaulted-loans ratio. |
getHoldingsAssetOwnership
function getHoldingsAssetOwnership(uint256 _pageIndex, uint256 _pageLength) external view returns (address[] assets_, uint256[] balances_)
Returns a paginated slice of holdings assets paired with the portfolio's current balance in each.
Parameters
| Name | Type | Description |
|---|
| _pageIndex | uint256 | Zero-based page index. |
| _pageLength | uint256 | Number of entries per page. |
Returns
| Name | Type | Description |
|---|
| assets_ | address[] | Slice of asset addresses for the requested page. |
| balances_ | uint256[] | Balances held by the portfolio for each entry in assets_. |
getHoldingsAssets
function getHoldingsAssets(uint256 _pageIndex, uint256 _pageLength) external view returns (address[] assets_)
Returns a paginated slice of every registered holdings asset address.
Parameters
| Name | Type | Description |
|---|
| _pageIndex | uint256 | Zero-based page index. |
| _pageLength | uint256 | Number of entries per page. |
Returns
| Name | Type | Description |
|---|
| assets_ | address[] | Slice of asset addresses for the requested page. |
getLoanHoldingsAssets
function getLoanHoldingsAssets(uint256 _pageIndex, uint256 _pageLength) external view returns (address[] assets_)
Returns a paginated slice of holdings assets whose type is LOAN.
Parameters
| Name | Type | Description |
|---|
| _pageIndex | uint256 | Zero-based page index. |
| _pageLength | uint256 | Number of entries per page. |
Returns
| Name | Type | Description |
|---|
| assets_ | address[] | Slice of loan-holdings addresses for the requested page. |
getLoansPortfolioData
function getLoansPortfolioData() external view returns (struct ILoansPortfolio.LoansPortfolioDetailsData loansPortfolioData_)
Returns the portfolio-level configuration captured at initialisation.
Returns
| Name | Type | Description |
|---|
| loansPortfolioData_ | ILoansPortfolio.LoansPortfolioDetailsData | The persisted portfolio configuration. |
function getNonPerformingLoansRatio() external view returns (uint256 numerator_, uint256 denominator_)
Returns the non-performing-loans ratio as a numerator/denominator pair.
Returns
| Name | Type | Description |
|---|
| numerator_ | uint256 | Numerator of the non-performing-loans ratio. |
| denominator_ | uint256 | Denominator of the non-performing-loans ratio. |
getNumberDefaultedLoans
function getNumberDefaultedLoans() external view returns (uint256 numberDefaultedLoans_)
Returns the count of loan holdings currently in default.
Returns
| Name | Type | Description |
|---|
| numberDefaultedLoans_ | uint256 | Count of defaulted loans. |
getNumberOfAssets
function getNumberOfAssets() external view returns (uint256 numberOfAssets_)
Returns the total number of registered holdings assets.
Returns
| Name | Type | Description |
|---|
| numberOfAssets_ | uint256 | Count of holdings assets. |
getNumberOfCash
function getNumberOfCash() external view returns (uint256 numberOfCash_)
Returns the count of holdings assets with type CASH.
Returns
| Name | Type | Description |
|---|
| numberOfCash_ | uint256 | Count of cash holdings. |
getNumberOfLoans
function getNumberOfLoans() external view returns (uint256 numberOfLoans_)
Returns the count of holdings assets with type LOAN.
Returns
| Name | Type | Description |
|---|
| numberOfLoans_ | uint256 | Count of loan holdings. |
function getNumberOfNonPerformingLoans() external view returns (uint256 numberOfNonPerformingLoans_)
Returns the count of loan holdings currently classified as non-performing.
Returns
| Name | Type | Description |
|---|
| numberOfNonPerformingLoans_ | uint256 | Count of non-performing loans. |
function getNumberOfPerformingLoans() external view returns (uint256 numberOfPerformingLoans_)
Returns the count of loan holdings currently classified as performing.
Returns
| Name | Type | Description |
|---|
| numberOfPerformingLoans_ | uint256 | Count of performing loans. |
function getPerformingLoansRatio() external view returns (uint256 numerator_, uint256 denominator_)
Returns the performing-loans ratio as a numerator/denominator pair.
Returns
| Name | Type | Description |
|---|
| numerator_ | uint256 | Numerator of the performing-loans ratio. |
| denominator_ | uint256 | Denominator of the performing-loans ratio. |
getSecuredLoansRatio
function getSecuredLoansRatio() external view returns (uint256 numerator_, uint256 denominator_)
Returns the secured-loans ratio as a numerator/denominator pair.
Pair semantics avoid loss-of-precision compared to a single fixed-point value.
Returns
| Name | Type | Description |
|---|
| numerator_ | uint256 | Numerator of the secured-loans ratio. |
| denominator_ | uint256 | Denominator of the secured-loans ratio. |
initializeLoansPortfolio
function initializeLoansPortfolio(ILoansPortfolio.LoansPortfolioDetailsData _loansPortfolioData) external nonpayable
Parameters
| Name | Type | Description |
|---|
| _loansPortfolioData | ILoansPortfolio.LoansPortfolioDetailsData | undefined |
loansPortfolioWithdraw
function loansPortfolioWithdraw(address _assetAddress, address _to, uint256 _amount) external nonpayable returns (bool success_)
Withdraws an amount from a holdings asset to an external recipient.
Parameters
| Name | Type | Description |
|---|
| _assetAddress | address | Holdings asset funds are drawn from. |
| _to | address | Recipient of the withdrawn amount. |
| _amount | uint256 | Amount to withdraw. |
Returns
| Name | Type | Description |
|---|
| success_ | bool | True when the withdrawal completed. |
notifyLoanHoldingsAssetUpdate
function notifyLoanHoldingsAssetUpdate(address _holdingsAssetAddress) external nonpayable returns (bool success_)
Broadcasts that the loan holdings asset's state has changed off-portfolio.
Pure notification path — does not mutate the underlying loan; merely emits LoanHoldingsAssetUpdated so indexers refresh their view.
Parameters
| Name | Type | Description |
|---|
| _holdingsAssetAddress | address | Address of the loan holdings asset that was updated. |
Returns
| Name | Type | Description |
|---|
| success_ | bool | True when the notification was accepted. |
removeHoldingsAsset
function removeHoldingsAsset(ILoansPortfolio.HoldingsAsset _holdingsAsset) external nonpayable returns (bool success_)
Parameters
| Name | Type | Description |
|---|
| _holdingsAsset | ILoansPortfolio.HoldingsAsset | undefined |
Returns
| Name | Type | Description |
|---|
| success_ | bool | undefined |
Events
HoldingsAssetAdded
event HoldingsAssetAdded(ILoansPortfolio.HoldingsAsset holdingsAsset)
Emitted when a new holdings asset is added to the portfolio.
Parameters
| Name | Type | Description |
|---|
| holdingsAsset | ILoansPortfolio.HoldingsAsset | The asset descriptor that was registered. |
HoldingsAssetRemoved
event HoldingsAssetRemoved(ILoansPortfolio.HoldingsAsset holdingsAsset)
Emitted when an existing holdings asset is removed from the portfolio.
Parameters
| Name | Type | Description |
|---|
| holdingsAsset | ILoansPortfolio.HoldingsAsset | The asset descriptor that was removed. |
LoanHoldingsAssetUpdated
event LoanHoldingsAssetUpdated(address loanHoldingsAsset)
Emitted when a registered loan holdings asset notifies a state update.
Parameters
| Name | Type | Description |
|---|
| loanHoldingsAsset | address | Address of the loan whose state was advertised. |
LoansPortfolioInitialized
event LoansPortfolioInitialized(ILoansPortfolio.LoansPortfolioDetailsData loansPortfolioData)
Emitted once when the LoansPortfolio capability is initialised on a token.
Fires exclusively from initializeLoansPortfolio after the storage write succeeds.
Parameters
| Name | Type | Description |
|---|
| loansPortfolioData | ILoansPortfolio.LoansPortfolioDetailsData | undefined |
LoansPortfolioWithdrawn
event LoansPortfolioWithdrawn(address assetAddress, address to, uint256 amount)
Emitted when funds are withdrawn from a holdings asset to an external account.
Parameters
| Name | Type | Description |
|---|
| assetAddress | address | Address of the holdings asset funds were drawn from. |
| to | address | Recipient of the withdrawn amount. |
| amount | uint256 | Amount transferred to the recipient. |
Errors
HoldingAssetNotFound
error HoldingAssetNotFound(address assetAddress)
Thrown when looking up a holdings asset that has not been registered.
Parameters
| Name | Type | Description |
|---|
| assetAddress | address | Address of the asset that was not found. |
HoldingsAssetAlreadyExists
error HoldingsAssetAlreadyExists(address assetAddress)
Thrown when adding a holdings asset that is already registered.
Parameters
| Name | Type | Description |
|---|
| assetAddress | address | Address of the asset that is already present. |
HoldingsAssetTypeNotSupported
error HoldingsAssetTypeNotSupported(uint8 holdingsAssetType)
Thrown when a holdings asset declares a type outside the supported set.
Parameters
| Name | Type | Description |
|---|
| holdingsAssetType | uint8 | The unsupported HoldingsAssetType value (as uint8). |