Conversation
| (uint256 feeAmount, uint256 feeShares) = asset.getFee(drawnIndex, previousIndex); | ||
| if (feeShares > 0) { | ||
| address feeReceiver = asset.feeReceiver; | ||
| asset.addedShares += feeShares; | ||
| spokes[assetId][feeReceiver].addedShares += feeShares; | ||
| asset.realizedFees = 0; | ||
| asset.addedShares += feeShares.toUint120(); | ||
| spokes[assetId][feeReceiver].addedShares += feeShares.toUint120(); | ||
| emit IHub.AccrueFees(assetId, feeReceiver, feeShares); | ||
| } else { | ||
| asset.realizedFees = feeAmount.toUint120(); | ||
| } |
There was a problem hiding this comment.
actually i think this logic needs to be replicated exactly on the preview also
There was a problem hiding this comment.
bc rn preview will think dust fee is donated whereas accrue will set it aside
There was a problem hiding this comment.
You mean to replicate it without changing state?
| // | ||
| uint120 addedShares; | ||
| uint120 swept; | ||
| uint120 realizedFees; |
There was a problem hiding this comment.
let's revert if gas costs are not impacted.
| /// @param assetId The identifier of the asset. | ||
| /// @param spoke The address of the current feeReceiver. | ||
| /// @param shares The amount of shares accrued. | ||
| event AccrueFees(uint256 indexed assetId, address spoke, uint256 shares); |
There was a problem hiding this comment.
why this instead of MintFeeShares
There was a problem hiding this comment.
it's what we had before & avoids confusion
| event UpdateAsset( | ||
| uint256 indexed assetId, | ||
| uint256 drawnIndex, | ||
| uint256 drawnRate, |
There was a problem hiding this comment.
we wanted to emit the drawnRate too, iirc
There was a problem hiding this comment.
we still do, only the last param ie realised fees is removed
| return asset.addedShares + asset.unrealizedFeeShares(); | ||
| } | ||
|
|
||
| /// @notice Returns the total added shares for the specified asset at specified indices. |
There was a problem hiding this comment.
| /// @notice Returns the total added shares for the specified asset at specified indices. | |
| /// @notice Returns the total added shares for the specified asset and drawn indices. |
| } | ||
|
|
||
| /// @notice Returns the total amount owed for the specified asset, including drawn and premium. | ||
| /// @notice Returns the total amount owed for the specified asset at specified drawnIndex. |
There was a problem hiding this comment.
| /// @notice Returns the total amount owed for the specified asset at specified drawnIndex. | |
| /// @notice Returns the total amount owed for the specified asset and drawn index. |
No description provided.