-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(solana-contracts): add Fees trait to unify fee handling for …
…propeller-variant ixs
- Loading branch information
Showing
18 changed files
with
503 additions
and
361 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use {crate::TOKEN_COUNT, anchor_lang::prelude::*, two_pool::BorshDecimal}; | ||
|
||
pub trait Fees { | ||
fn calculate_fees_in_lamports(&self) -> Result<u64>; | ||
fn convert_fees_to_swim_usd_atomic( | ||
&self, | ||
fee_in_lamports: u64, | ||
marginal_prices: [BorshDecimal; TOKEN_COUNT], | ||
max_staleness: i64, | ||
) -> Result<u64>; | ||
fn track_and_transfer_fees(&mut self, fees_in_swim_usd: u64) -> Result<()>; | ||
} |
343 changes: 116 additions & 227 deletions
343
packages/solana-contracts/programs/propeller/src/instructions/create_owner_token_accounts.rs
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
Oops, something went wrong.