Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implements entry/redemption fees #55

Merged
merged 7 commits into from
Dec 18, 2024
Merged

Conversation

vito-kovalione
Copy link
Contributor

No description provided.

Copy link
Contributor

@TonioMacaronio TonioMacaronio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question, should there be the events emitted when fees are changed?

pub struct PerformanceFeeUpdatedEvent {
pub accountant_key: Pubkey,
pub performance_fee: u64,
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be useful to also include timestamp to
PerformanceFeeUpdatedEvent, EntryFeeUpdatedEvent, RedemptionFeeUpdatedEvent
so that we can keep track of the fee changing history easily.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we have a timestamp in the transaction data?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, No need to strictly use Clock sysvar timestamp.

@@ -53,22 +64,31 @@ impl Accountant for GenericAccountant {
)
}

fn set_fee(&mut self, fee: u64) -> Result<()> {
fn set_performance_fee(&mut self, fee: u64) -> Result<()> {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for
set_performance_fee, set_redemption_fee, set_entry_fee fn
we can consider adding a condition that fee arg be less or equal to FEE_BPS constant value, just to ensure that the fee won't be over 100%

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sense, will add validation


#[account(
mut,
associated_token::mint = shares_mint,
Copy link

@codinghistorian codinghistorian Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The accountant requires a token account based on the share_mint. In my opinion, it would be nice if the InitTokenAccount context of the accountant program used a more generic naming convention for the mint account, rather than underlying_mint (which, in the context of this repository, refers to the underlying_asset that users can invest with). At the very least, the current naming caused some confusion for me.

@vito-kovalione vito-kovalione merged commit 01c13ba into dev Dec 18, 2024
1 check passed
@vito-kovalione vito-kovalione deleted the deposit_withdraw_fees branch December 18, 2024 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants