Skip to main content

SecuritizationPoolValueService

SecuritizationPoolValueService

Calculate pool's values

RATE_SCALING_FACTOR

uint256 RATE_SCALING_FACTOR

YEAR_LENGTH_IN_DAYS

uint256 YEAR_LENGTH_IN_DAYS

MINUTE_LENGTH_IN_SECONDS

uint256 MINUTE_LENGTH_IN_SECONDS

HOUR_LENGTH_IN_SECONDS

uint256 HOUR_LENGTH_IN_SECONDS

DAY_LENGTH_IN_SECONDS

uint256 DAY_LENGTH_IN_SECONDS

YEAR_LENGTH_IN_SECONDS

uint256 YEAR_LENGTH_IN_SECONDS

getAssetInterestRates

function getAssetInterestRates(address poolAddress, bytes32[] tokenIds) public view returns (uint256[])

Returns an array of interest rates for each token in tokenIds.

The length of the returned array will be equal to the length of tokenIds.

Parameters

NameTypeDescription
poolAddressaddressAddress of the securitization pool from which to get the interest rates.
tokenIdsbytes32[]Array of bytes32 IDs for each asset whose interest rate is requested.

Return Values

NameTypeDescription
[0]uint256[]interestRates An array containing the interest rates corresponding to tokenIds.

getAssetInterestRate

function getAssetInterestRate(address poolAddress, bytes32 tokenId) public view returns (uint256)

This function returns the interest rate of an asset in a pool.

Parameters

NameTypeDescription
poolAddressaddressThe address of the pool where the asset resides.
tokenIdbytes32The id of the token for which we want to get the interest rate.

Return Values

NameTypeDescription
[0]uint256Returns the interest rate of the specified asset.

getAssetRiskScores

function getAssetRiskScores(address poolAddress, bytes32[] tokenIds) public view returns (uint256[])

This function retrieves the risk scores of a list of assets in a pool.

Parameters

NameTypeDescription
poolAddressaddressThe address of the pool from which to retrieve the asset risk scores.
tokenIdsbytes32[]An array containing the IDs of the tokens for which to retrieve the risk score.

Return Values

NameTypeDescription
[0]uint256[]Returns an array of uint256 values representing the risk scores of each respective token in tokenIds.

getExpectedLATAssetValue

function getExpectedLATAssetValue(address poolAddress) public view returns (uint256)

Get the expected LAT asset value from a securitization pool

Parameters

NameTypeDescription
poolAddressaddressThe address of the securitization pool

Return Values

NameTypeDescription
[0]uint256uint256 The current net asset value (NAV) of the pool

getExpectedAssetValue

function getExpectedAssetValue(address poolAddress, bytes32 tokenId) public view returns (uint256)

Returns the expected asset value of an asset in a pool.

This is used by the SecuritizationPoolValueService contract to calculate the total value of all assets in a pool.

Parameters

NameTypeDescription
poolAddressaddressThe address of the pool from which to get the asset value.
tokenIdbytes32The ID of the token for which to get the value.

Return Values

NameTypeDescription
[0]uint256uint256 Returns the expected asset value.

getExpectedAssetValues

function getExpectedAssetValues(address poolAddress, bytes32[] tokenIds) public view returns (uint256[] expectedAssetsValues)

Retrieves expected asset values for given token IDs in a pool

Parameters

NameTypeDescription
poolAddressaddressAddress of the pool
tokenIdsbytes32[]Array of bytes32 representing token IDs

Return Values

NameTypeDescription
expectedAssetsValuesuint256[]An array of uint256 representing expected asset values

getDebtAssetValues

function getDebtAssetValues(address poolAddress, bytes32[] tokenIds) public view returns (uint256[] debtAssetsValues)

Returns an array of values representing the current value of each debt asset in a pool.

Parameters

NameTypeDescription
poolAddressaddressThe address of the pool from which to retrieve the data.
tokenIdsbytes32[]An array of bytes32 IDs corresponding to the debt assets whose values are being requested.

Return Values

NameTypeDescription
debtAssetsValuesuint256[]An array of uint256 representing the current value of each debt asset in the pool.

getExpectedAssetsValue

function getExpectedAssetsValue(address poolAddress) public view returns (uint256)

Get the expected assets value from a securitization pool.

This function returns the expected LAT asset value of a given securitization pool address.

Parameters

NameTypeDescription
poolAddressaddressThe address of the securitization pool.

Return Values

NameTypeDescription
[0]uint256uint256 Returns the expected LAT asset value.

getPoolValue

function getPoolValue(address poolAddress) public view returns (uint256)

Returns the total value of a securitization pool including the expected assets value and the current balance in the pool.

Parameters

NameTypeDescription
poolAddressaddressAddress of the pool to get the value from.

Return Values

NameTypeDescription
[0]uint256Total value of the securitization pool.

getJuniorRatio

function getJuniorRatio(address poolAddress) public view returns (uint256)

Returns the junior ratio of a pool.

Parameters

NameTypeDescription
poolAddressaddressThe address of the pool to get the junior ratio from.

Return Values

NameTypeDescription
[0]uint256uint256 The junior ratio of the pool.

getApprovedReserved

function getApprovedReserved(address poolAddress) public view returns (uint256 approvedReserved)

Returns the current allowance for the pool pot to spend on behalf of the pool address.

Parameters

NameTypeDescription
poolAddressaddressThe address of the pool.

Return Values

NameTypeDescription
approvedReserveduint256The amount that is currently allowed to be spent by the pool pot.

getMaxAvailableReserve

function getMaxAvailableReserve(address poolAddress, uint256 sotRequest) public view returns (uint256, uint256, uint256)

Get the maximum available reserve to withdraw.

Parameters

NameTypeDescription
poolAddressaddressAddress of the pool.
sotRequestuint256Amount of SOT requested for withdrawal.

Return Values

NameTypeDescription
[0]uint256The amount of JOT and SOT that can be withdrawn, along with the corresponding amounts in currency.
[1]uint256
[2]uint256

getSOTTokenPrice

function getSOTTokenPrice(address securitizationPool) public view returns (uint256)

This function returns the current price of SOT tokens in the specified securitization pool.

Parameters

NameTypeDescription
securitizationPooladdressThe address of the Securitization Pool contract.

Return Values

NameTypeDescription
[0]uint256sotTokenPrice The current price of SOT tokens in wei.

calcCorrespondingTotalAssetValue

function calcCorrespondingTotalAssetValue(address tokenAddress, address investor) public view returns (uint256)

Calculates the corresponding total asset value of a specific token and an investor.

Parameters

NameTypeDescription
tokenAddressaddressThe address of the token to calculate the value for.
investoraddressThe address of the investor whose assets are being valued.

Return Values

NameTypeDescription
[0]uint256The calculated total asset value.

_calcCorrespondingAssetValue

function _calcCorrespondingAssetValue(address tokenAddress, address investor) internal view returns (uint256)

Calculates the corresponding asset value of an investor's token balance based on the price per token from a pool.

Parameters

NameTypeDescription
tokenAddressaddressThe address of the note token contract.
investoraddressThe address of the investor.

Return Values

NameTypeDescription
[0]uint256The calculated value in wei.

calcCorrespondingAssetValue

function calcCorrespondingAssetValue(address tokenAddress, address[] investors) external view returns (uint256[] values)

Calculates corresponding asset value for each investor

Parameters

NameTypeDescription
tokenAddressaddressAddress of the token
investorsaddress[]Array of addresses of investors

Return Values

NameTypeDescription
valuesuint256[]An array containing calculated corresponding asset values

calcTokenPrice

function calcTokenPrice(address pool, address tokenAddress) public view returns (uint256)

Calculates the price of a token in a securitization pool.

Parameters

NameTypeDescription
pooladdressThe address of the securitization pool.
tokenAddressaddressThe address of the token for which to calculate the price.

Return Values

NameTypeDescription
[0]uint256The price of the token in wei.

getTokenPrices

function getTokenPrices(address[] pools, address[] tokenAddresses) public view returns (uint256[] tokenPrices)

Retrieve token prices for each pool in the given list

Calculates the price of a specific token in each pool

Parameters

NameTypeDescription
poolsaddress[]List of securitization pools to retrieve prices from
tokenAddressesaddress[]List of tokens to calculate prices for

Return Values

NameTypeDescription
tokenPricesuint256[]Array of calculated prices, one for each pool

getTokenValues

function getTokenValues(address[] tokenAddresses, address[] investors) public view returns (uint256[] tokenValues)

Calculates corresponding asset value for each investor based on their tokens

Parameters

NameTypeDescription
tokenAddressesaddress[]Array of addresses representing different tokens
investorsaddress[]Array of addresses representing different investors

Return Values

NameTypeDescription
tokenValuesuint256[]An array containing the calculated values for each investor

getJOTTokenPrice

function getJOTTokenPrice(address securitizationPool) public view returns (uint256)

Returns the current price of JOT tokens in the securitization pool

Parameters

NameTypeDescription
securitizationPooladdressAddress of the Securitization Pool

Return Values

NameTypeDescription
[0]uint256jotTokenPrice The current price of JOT tokens

getCashBalance

function getCashBalance(address pool) external view returns (uint256)

Returns the current cash balance of the pool.

Parameters

NameTypeDescription
pooladdressThe address of the pool.

Return Values

NameTypeDescription
[0]uint256The current cash balance of the pool in terms of underlying currency.