Skip to content

PegStabilityModuleYield

senamakel edited this page Nov 27, 2024 · 2 revisions

Solidity API

PegStabilityModuleYield

initialize

function initialize(address _zai, address _collateral, address _governance, uint256 _supplyCap, uint256 _debtCap, uint256 _mintFeeBps, uint256 _redeemFeeBps, address _feeDestination) external

rate

function rate() public view returns (uint256)

Calculates the value of assets per share in the collateral pool.

Uses total assets and total supply from the collateral to compute the ratio.

Return Values

Name Type Description
[0] uint256 The asset value per share in 18 decimal precision.

feesCollected

function feesCollected() public view returns (uint256 yield)

Transfers yield from the collateral to the fee distributor if yield exceeds debt.

Computes yield based on the collateral balance and transfers it to the fee distributor if the current value of collateral exceeds the outstanding debt. Uses safeTransfer to ensure secure transfer of assets.

Clone this wiki locally