RoycoAssetClaims

Documentation for eth_defi.erc_4626.vault_protocol.royco.vault.RoycoAssetClaims Python class.

class RoycoAssetClaims

Bases: object

Royco tranche asset claims.

Royco tranche vaults return this struct from totalAssets(), convertToAssets(uint256), previewRedeem(uint256) and redeem(...).

Attributes summary

st_assets

jt_assets

nav

Methods summary

__init__(st_assets, jt_assets, nav)

convert_jt_assets_to_decimal(tranche_unit_token)

Convert junior tranche asset claims to a decimal value.

convert_nav_to_decimal(nav_unit_token)

Convert Royco raw NAV units to a decimal value.

convert_st_assets_to_decimal(tranche_unit_token)

Convert senior tranche asset claims to a decimal value.

__init__(st_assets, jt_assets, nav)
Parameters
  • st_assets (int) –

  • jt_assets (int) –

  • nav (int) –

Return type

None

convert_jt_assets_to_decimal(tranche_unit_token)

Convert junior tranche asset claims to a decimal value.

Royco’s AssetClaims struct stores tranche asset claims as raw token-like units. Use eth_defi.token.TokenDetails for the conversion so the caller chooses the correct unit precision instead of hardcoding decimals.

Parameters

tranche_unit_token (eth_defi.token.TokenDetails) – Token details that define the junior tranche asset unit precision.

Returns

Junior tranche asset claims as a decimal value.

Return type

decimal.Decimal

convert_nav_to_decimal(nav_unit_token)

Convert Royco raw NAV units to a decimal value.

Royco’s ABI exposes NAV values as NAV_UNIT instead of a plain ERC-20 asset amount. For the currently deployed tranche contracts, this unit uses the tranche share token precision, while the denomination token may have a different number of decimals. Use eth_defi.token.TokenDetails for the conversion so the reader does not hardcode token precision.

Parameters

nav_unit_token (eth_defi.token.TokenDetails) – Token details that define the NAV unit decimal precision.

Returns

Decimal NAV value.

Return type

decimal.Decimal

convert_st_assets_to_decimal(tranche_unit_token)

Convert senior tranche asset claims to a decimal value.

Royco’s AssetClaims struct stores tranche asset claims as raw token-like units. Use eth_defi.token.TokenDetails for the conversion so the caller chooses the correct unit precision instead of hardcoding decimals.

Parameters

tranche_unit_token (eth_defi.token.TokenDetails) – Token details that define the senior tranche asset unit precision.

Returns

Senior tranche asset claims as a decimal value.

Return type

decimal.Decimal