-
-
Notifications
You must be signed in to change notification settings - Fork 72
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
Combined protocol "program" fees #244
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…IP updating tests to include the fee
…to spl test library.
This was referenced Sep 6, 2024
Closed
Can we add a group and a bank level flag to disable program fees for groups that we own? |
jkbpvsc
requested changes
Oct 15, 2024
programs/marginfi/src/instructions/marginfi_group/config_group_fee.rs
Outdated
Show resolved
Hide resolved
programs/marginfi/src/instructions/marginfi_group/init_global_fee_state.rs
Show resolved
Hide resolved
…dation to avoid setting disused flags.
…marginfi-v2 into combined-protocol-fees
jkbpvsc
approved these changes
Oct 18, 2024
programs/marginfi/src/instructions/marginfi_group/init_global_fee_state.rs
Outdated
Show resolved
Hide resolved
16 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Replaces #243 and #223
In addition to what is already covered in those PRs:
The
FeeState
account (unique per program) now administers "program fees", which go directly to theFeeState.global_fee_wallet
's canonical ATA for any given bank's mint. For example, if a third party opens a new group and a new bank, the program fee will always go toget_associated_token_address(FeeState.global_fee_wallet, bank.mint)
.Groups will cache the program fees and the fee state's global fee wallet, which the global fee admin can change at any time. When fees update, they will propagate to groups using the permissionless
propagate_fee
ix.The global fee state admin can enable/disable program fees for any group without the group admin's permission.
Note that fees which go to the group are still called "protocol" or "group" fees for legacy purposes. The new fees are always referred to as "program" fees.
FE/API considerations:
marginfi_group_initialize
andlending_pool_collect_bank_fees
(due to hard coded seed derivation of FeeState, all added accounts are anchor inferred, and thus should be seamless if usingprogram.methods
syntax)WIP: