Skip to content

Commit 4612bcc

Browse files
author
Barnabas Ratki
committed
chore: fix precision changes, and use macro in more places
1 parent 8719866 commit 4612bcc

3 files changed

Lines changed: 134 additions & 209 deletions

File tree

contracts/svm/programs/express_relay/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,11 +455,11 @@ pub struct SwapV2Args {
455455
pub deadline: i64,
456456
pub amount_searcher: u64,
457457
pub amount_user: u64,
458-
/// The referral fee is specified in mill percentile
458+
/// The referral fee is specified in parts per million
459459
pub referral_fee_ppm: u64,
460460
/// Token in which the fees will be paid
461461
pub fee_token: FeeToken,
462-
/// The platform fee is specified in mill percentile
462+
/// The platform fee is specified in parts per million
463463
pub swap_platform_fee_ppm: u64,
464464
}
465465

@@ -524,12 +524,12 @@ pub struct Swap<'info> {
524524
pub mint_searcher: Box<InterfaceAccount<'info, Mint>>,
525525

526526
#[account(mint::token_program = token_program_user)]
527-
/// CHECK: we check that this is set correctly based on the fee token manually since the V2 arguments are incompatible on the wire
528527
pub mint_user: Box<InterfaceAccount<'info, Mint>>,
529528

530529
#[account(
531530
mint::token_program = token_program_fee,
532531
)]
532+
/// CHECK: we check that this is set correctly based on the fee token manually since the V2 arguments are incompatible on the wire
533533
pub mint_fee: Box<InterfaceAccount<'info, Mint>>,
534534

535535
// Token programs

contracts/svm/programs/express_relay/src/state.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use anchor_lang::prelude::*;
22

33
pub const FEE_SPLIT_PRECISION: u64 = 10_000;
44

5-
pub const FEE_SPLIT_PRECISION_PPM: u64 = 100_000_000;
6-
pub const FEE_BPS_TO_PPM: u64 = 10_000;
5+
pub const FEE_SPLIT_PRECISION_PPM: u64 = 1_000_000;
6+
pub const FEE_BPS_TO_PPM: u64 = 100;
77

88
pub const RESERVE_EXPRESS_RELAY_METADATA: usize = 8 + 152 + 260;
99
pub const SEED_METADATA: &[u8] = b"metadata";

0 commit comments

Comments
 (0)