Conversation
|
|
||
| address oldFeeReceiver = asset.feeReceiver; | ||
| if (oldFeeReceiver != config.feeReceiver) { | ||
| _mintFeeShares(asset, assetId); |
| @@ -209,7 +209,7 @@ | |||
| function mintFeeShares(uint256 assetId) external restricted returns (uint256) { | |||
There was a problem hiding this comment.
todo: determine if we want to keep this around, but doesnt seem necessary
There was a problem hiding this comment.
We mentioned that if there is no action for a while, we might want to manually trigger this, even with this kind of implementation
| uint256 accruedFees | ||
| ); | ||
|
|
||
| event AccrueFees(uint256 indexed assetId, address feeReceiver, uint256 feeShares); |
There was a problem hiding this comment.
TODO: we need to add natspec here
| return asset.drawn(drawnIndex) + asset.premium(drawnIndex); | ||
| } | ||
|
|
||
| /// @notice Returns the total added assets for the specified asset. |
There was a problem hiding this comment.
Why was this comment removed?
| return asset.totalAddedAssets(asset.getDrawnIndex()); | ||
| } | ||
|
|
||
| /// @notice Returns the total added assets for the specified asset. |
There was a problem hiding this comment.
this could at the end say "at the specified drawnIndex"
| aggregatedOwedRay.fromRayUp() - | ||
| asset.realizedFees - | ||
| asset.getUnrealizedFees(drawnIndex); | ||
| return asset.liquidity + asset.swept + aggregatedOwedRay.fromRayUp(); |
There was a problem hiding this comment.
Why not subtract out unrealizedFees?
There was a problem hiding this comment.
Oh, so we are including the unrealized both in the numerator and denominator now? (both assets and shares)
There was a problem hiding this comment.
no we will remove unrealised fees from this impl and go back to what we had before (only on denominator)
| (aggregatedOwedRayAfter.fromRayUp() - aggregatedOwedRayBefore.fromRayUp()).percentMulDown( | ||
| liquidityFee | ||
| feeAmount.toSharesDown( | ||
| asset.liquidity + asset.swept + aggregatedOwedAfter - feeAmount, |
There was a problem hiding this comment.
subtracted out feeAmount because this should be the share rate before the current action (before these fees are accrued), so this looks good
|
|
||
| /// @notice Calculates the amount of fee shares derived from the index growth due to interest accrual. | ||
| /// @dev The true liquidity growth is always greater than accrued fees, even with 100.00% liquidity fee. | ||
| function getFeeShares( |
There was a problem hiding this comment.
Should we specify that we are rounding down (which I think is correct btw) in natspec dev comment?
| } | ||
| } | ||
|
|
||
| /// @notice Calculates the drawn index of a specified asset based on the existing drawn rate and index. |
There was a problem hiding this comment.
Why removing natspec?
Co-authored-by: Cheyenne Atapour <cheyenneatapour@gmail.com>
No description provided.