From c0e038652b43be874d5fbea6cbe56787d61e36c8 Mon Sep 17 00:00:00 2001 From: --systemdf Date: Tue, 1 Jul 2025 14:23:16 -0500 Subject: [PATCH 1/5] add minimum platform fees --- auction-server/api-types/src/opportunity.rs | 4 +- auction-server/config.sample.yaml | 6 +- auction-server/src/api.rs | 2 +- auction-server/src/config.rs | 19 ++++- .../src/opportunity/service/get_quote.rs | 27 +++++-- auction-server/src/opportunity/service/mod.rs | 73 +++++++++++++++---- integration.py | 8 +- sdk/rust/src/lib.rs | 1 + sdk/rust/src/svm.rs | 1 + 9 files changed, 112 insertions(+), 29 deletions(-) diff --git a/auction-server/api-types/src/opportunity.rs b/auction-server/api-types/src/opportunity.rs index ba77caa3b..19b540fe6 100644 --- a/auction-server/api-types/src/opportunity.rs +++ b/auction-server/api-types/src/opportunity.rs @@ -225,15 +225,17 @@ pub enum OpportunityParamsV1ProgramSvm { #[serde_as(as = "DisplayFromStr")] router_account: Pubkey, + #[deprecated = "This field is deprecated and will be removed in a future release."] // TODO this should be deleted /// The referral fee in basis points. - #[schema(example = 10)] + #[schema(example = 10, deprecated)] referral_fee_bps: u16, /// The referral fee in parts per million. #[schema(example = 1000)] referral_fee_ppm: u64, + #[deprecated = "This field is deprecated and will be removed in a future release."] // TODO this should be deleted /// The platform fee in basis points. #[schema(example = 10)] diff --git a/auction-server/config.sample.yaml b/auction-server/config.sample.yaml index ada956ede..61fd5d0e9 100644 --- a/auction-server/config.sample.yaml +++ b/auction-server/config.sample.yaml @@ -30,7 +30,7 @@ chains: - So11111111111111111111111111111111111111112 - EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v allow_permissionless_quote_requests: true - minimum_fee_list: + minimum_referral_fee_list: profiles: - profile_id: 0b059fa2-189f-4498-a646-e7ee1ed79c3c minimum_fees: @@ -38,6 +38,10 @@ chains: fee_ppm: 100 - mint: So11111111111111111111111111111111111111112 fee_ppm: 200 + minimum_platform_fee_list: + minimum_fees: + - mint: So11111111111111111111111111111111111111112 + fee_ppm: 100 lazer: price_feeds: diff --git a/auction-server/src/api.rs b/auction-server/src/api.rs index 298da87d5..50de94cf2 100644 --- a/auction-server/src/api.rs +++ b/auction-server/src/api.rs @@ -376,7 +376,7 @@ impl std::fmt::Display for SwapInstructionError { ), SwapInstructionError::ReferralFee { expected, found } => write!( f, - "Invalid referral fee bps {} in swap instruction data. Value does not match the referral fee bps in swap opportunity {}", + "Invalid referral fee ppm {} in swap instruction data. Value does not match the referral fee ppm in swap opportunity {}", found, expected ), SwapInstructionError::AssociatedRouterTokenAccount { expected, found } => write!( diff --git a/auction-server/src/config.rs b/auction-server/src/config.rs index dc00a0486..70475c709 100644 --- a/auction-server/src/config.rs +++ b/auction-server/src/config.rs @@ -175,9 +175,12 @@ pub struct ConfigSvm { /// Whitelisted token mints #[serde(default)] pub token_whitelist: TokenWhitelistConfig, - /// Minimum fee list + /// Minimum referral fee list #[serde(default)] - pub minimum_fee_list: MinimumFeeListConfig, + pub minimum_referral_fee_list: MinimumReferralFeeListConfig, + /// Minimum platform fee list + #[serde(default)] + pub minimum_platform_fee_list: MinimumPlatformFeeListConfig, /// Whether to allow permissionless quote requests. #[serde(default)] pub allow_permissionless_quote_requests: bool, @@ -207,14 +210,22 @@ pub struct TokenWhitelistConfig { pub whitelist_mints: Vec, } -/// Optional minimum fee list to determine validity of quote request +/// Minimum referral fee list to determine validity of quote request #[serde_as] #[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] -pub struct MinimumFeeListConfig { +pub struct MinimumReferralFeeListConfig { #[serde(default)] pub profiles: Vec, } +/// Minimum platform fee list to determine platform fees to apply to quote requests +#[serde_as] +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct MinimumPlatformFeeListConfig { + #[serde(default)] + pub minimum_fees: Vec, +} + #[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] pub struct MinimumFeeProfile { pub profile_id: Option, diff --git a/auction-server/src/opportunity/service/get_quote.rs b/auction-server/src/opportunity/service/get_quote.rs index dbad09e16..bc4b1e031 100644 --- a/auction-server/src/opportunity/service/get_quote.rs +++ b/auction-server/src/opportunity/service/get_quote.rs @@ -53,7 +53,10 @@ use { solana_sdk::pubkey::Pubkey, spl_associated_token_account::get_associated_token_address_with_program_id, spl_token::native_mint, - std::time::Duration, + std::{ + cmp::max, + time::Duration, + }, time::OffsetDateTime, tokio::time::sleep, }; @@ -214,6 +217,14 @@ impl Service { }) .await?; + let platform_fee_pair_ppm = config + .get_platform_fee_ppm(&mint_user, &mint_searcher) + .unwrap_or(0); + let platform_fee_ppm = max( + platform_fee_pair_ppm, + metadata.swap_platform_fee_bps * FEE_BPS_TO_PPM, + ); + let fee_token = get_fee_token(mint_user, mint_searcher, &config.ordered_fee_tokens); let (searcher_amount, user_amount) = match (quote_create.tokens.clone(), fee_token.clone()) { @@ -224,15 +235,14 @@ impl Service { // This is not exactly accurate and may overestimate the amount needed // because of floor / ceil rounding errors. let referral_fee_ppm = referral_fee_info.referral_fee_ppm; - let swap_platform_fee_ppm = metadata.swap_platform_fee_bps * FEE_BPS_TO_PPM; - if referral_fee_ppm + swap_platform_fee_ppm >= FEE_SPLIT_PRECISION_PPM { + if referral_fee_ppm + platform_fee_ppm >= FEE_SPLIT_PRECISION_PPM { return Err(RestError::BadParameters(format!( "Referral fee ppm + platform fee ppm must be less than {}", FEE_SPLIT_PRECISION_PPM ))); } let denominator: u64 = - FEE_SPLIT_PRECISION_PPM - referral_fee_ppm - swap_platform_fee_ppm; + FEE_SPLIT_PRECISION_PPM - referral_fee_ppm - platform_fee_ppm; let numerator = searcher_token.amount * FEE_SPLIT_PRECISION_PPM; let amount_including_fees = numerator.div_ceil(denominator); (amount_including_fees, 0u64) @@ -349,7 +359,7 @@ impl Service { // token_account_initialization_configs.router_fee_receiver_ta = // TokenAccountInitializationConfig::Unneeded; } - if metadata.swap_platform_fee_bps == 0 { + if platform_fee_ppm == 0 { // If the platform fee is 0, we can skip the initialization of the express relay and relayer token accounts token_account_initialization_configs.express_relay_fee_receiver_ata = TokenAccountInitializationConfig::Unneeded; @@ -374,8 +384,11 @@ impl Service { fee_token, referral_fee_bps, referral_fee_ppm: referral_fee_info.referral_fee_ppm, - platform_fee_bps: metadata.swap_platform_fee_bps, - platform_fee_ppm: metadata.swap_platform_fee_bps * FEE_BPS_TO_PPM, + // TODO: we should deprecate and then get rid of the bps fields. + // For now we keep them for backwards compatibility, and generally the fees are in bp units. + // But if searchers are using the bps fields to calculate the ppm fields, this will lead to SwapInstructionError::PlatformFee if the fees are ever non-unit bps. + platform_fee_bps: platform_fee_ppm / FEE_BPS_TO_PPM, + platform_fee_ppm, token_program_user, user_mint_user_balance, token_account_initialization_configs, diff --git a/auction-server/src/opportunity/service/mod.rs b/auction-server/src/opportunity/service/mod.rs index 0d4bd9224..3bdc1d750 100644 --- a/auction-server/src/opportunity/service/mod.rs +++ b/auction-server/src/opportunity/service/mod.rs @@ -12,7 +12,8 @@ use { self as auction_service, }, config::{ - MinimumFeeListConfig, + MinimumPlatformFeeListConfig, + MinimumReferralFeeListConfig, TokenWhitelistConfig, }, kernel::{ @@ -115,7 +116,8 @@ pub struct ConfigSvm { pub ordered_fee_tokens: Vec, pub auction_service_container: AuctionServiceContainer, pub token_whitelist: TokenWhitelist, - pub minimum_fee_list: MinimumFeeList, + pub minimum_referral_fee_list: MinimumReferralFeeList, + pub minimum_platform_fee_list: Vec, pub allow_permissionless_quote_requests: bool, pub auction_time: Duration, } @@ -150,9 +152,14 @@ impl ConfigSvm { .token_whitelist .clone() .into(), - minimum_fee_list: chain_store + minimum_referral_fee_list: chain_store .config - .minimum_fee_list + .minimum_referral_fee_list + .clone() + .into(), + minimum_platform_fee_list: chain_store + .config + .minimum_platform_fee_list .clone() .into(), allow_permissionless_quote_requests: chain_store @@ -219,10 +226,10 @@ impl ConfigSvm { } let minimum_fee_searcher = self - .minimum_fee_list + .minimum_referral_fee_list .get_minimum_fee(&mint_searcher, profile_id); let minimum_fee_user = self - .minimum_fee_list + .minimum_referral_fee_list .get_minimum_fee(&mint_user, profile_id); if referral_fee_ppm @@ -255,11 +262,35 @@ impl ConfigSvm { Ok(()) } + + pub fn get_platform_fee_ppm(&self, mint_user: &Pubkey, mint_searcher: &Pubkey) -> Option { + let fee_user = self.minimum_platform_fee_list.iter().find_map(|fee| { + if &fee.mint == mint_user { + Some(fee.fee_ppm) + } else { + None + } + }); + let fee_searcher = self.minimum_platform_fee_list.iter().find_map(|fee| { + if &fee.mint == mint_searcher { + Some(fee.fee_ppm) + } else { + None + } + }); + + match (fee_user, fee_searcher) { + (Some(user_fee), Some(searcher_fee)) => Some(max(user_fee, searcher_fee)), + (Some(user_fee), None) => Some(user_fee), + (None, Some(searcher_fee)) => Some(searcher_fee), + (None, None) => None, + } + } } -/// Optional minimum fee list for token mints +/// Optional minimum referral fee list for token mints #[derive(Clone, Default)] -pub struct MinimumFeeList { +pub struct MinimumReferralFeeList { pub profiles: Vec, } @@ -275,7 +306,7 @@ pub struct MinimumFee { pub fee_ppm: u64, } -impl MinimumFeeList { +impl MinimumReferralFeeList { pub fn get_minimum_fee(&self, mint: &Pubkey, profile_id: Option) -> Option { let mut minimum_fee = self .profiles @@ -289,8 +320,8 @@ impl MinimumFeeList { .map(|fee| fee.fee_ppm) }); - // The minimum fee list can include an entry with no profile_id, which can be used as a fallback if no match is found for the specific profile_id. - // This allows for a default minimum fee to be applied if no specific profile is found. + // The minimum referral fee list can include an entry with no profile_id, which can be used as a fallback if no match is found for the specific profile_id. + // This allows for a default minimum referral fee to be applied if no specific profile is found. if minimum_fee.is_none() { minimum_fee = self .profiles @@ -309,8 +340,8 @@ impl MinimumFeeList { } } -impl From for MinimumFeeList { - fn from(value: MinimumFeeListConfig) -> Self { +impl From for MinimumReferralFeeList { + fn from(value: MinimumReferralFeeListConfig) -> Self { Self { profiles: value .profiles @@ -331,6 +362,19 @@ impl From for MinimumFeeList { } } +impl From for Vec { + fn from(value: MinimumPlatformFeeListConfig) -> Self { + value + .minimum_fees + .into_iter() + .map(|fee| MinimumFee { + mint: fee.mint, + fee_ppm: fee.fee_ppm, + }) + .collect() + } +} + /// Optional whitelist for token mints #[derive(Clone, Default)] pub struct TokenWhitelist { @@ -433,7 +477,8 @@ pub mod tests { ordered_fee_tokens: vec![], auction_service_container: AuctionServiceContainer::new(), token_whitelist: Default::default(), - minimum_fee_list: Default::default(), + minimum_referral_fee_list: Default::default(), + minimum_platform_fee_list: Default::default(), allow_permissionless_quote_requests: true, auction_time: config::ConfigSvm::default_auction_time(), }; diff --git a/integration.py b/integration.py index 76c9cdf30..821c68978 100644 --- a/integration.py +++ b/integration.py @@ -42,7 +42,7 @@ def main(): - {mint_sell} - So11111111111111111111111111111111111111112 allow_permissionless_quote_requests: true - minimum_fee_list: + minimum_referral_fee_list: profiles: - profile_id: 4b4f8bcf-415a-4509-be21-bd803cdc8937 minimum_fees: @@ -50,6 +50,12 @@ def main(): fee_ppm: 200 - mint: {mint_sell} fee_ppm: 0 + minimum_platform_fee_list: + minimum_fees: + - mint: {mint_buy} + fee_ppm: 100 + - mint: {mint_sell} + fee_ppm: 1099 lazer: price_feeds: - id: 1 diff --git a/sdk/rust/src/lib.rs b/sdk/rust/src/lib.rs index f5624dda3..63a4007ba 100644 --- a/sdk/rust/src/lib.rs +++ b/sdk/rust/src/lib.rs @@ -657,6 +657,7 @@ impl Client { /// # Returns /// /// * `Result` - A bid creation object or an error. + #[allow(deprecated)] pub async fn new_bid( &self, opportunity: api_types::opportunity::OpportunitySvm, diff --git a/sdk/rust/src/svm.rs b/sdk/rust/src/svm.rs index 376cd58f4..23ad4c604 100644 --- a/sdk/rust/src/svm.rs +++ b/sdk/rust/src/svm.rs @@ -303,6 +303,7 @@ impl Svm { .collect() } + #[allow(deprecated)] fn extract_swap_data( opportunity_params: &OpportunityParamsSvm, ) -> Result { From 4f142be917911c8c3e63ebc7ed22bb269ccf430a Mon Sep 17 00:00:00 2001 From: --systemdf Date: Tue, 1 Jul 2025 16:52:20 -0500 Subject: [PATCH 2/5] fix rust sdk --- sdk/rust/src/lib.rs | 5 ++--- sdk/rust/src/svm.rs | 14 ++++++-------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/sdk/rust/src/lib.rs b/sdk/rust/src/lib.rs index 63a4007ba..99cefb182 100644 --- a/sdk/rust/src/lib.rs +++ b/sdk/rust/src/lib.rs @@ -657,7 +657,6 @@ impl Client { /// # Returns /// /// * `Result` - A bid creation object or an error. - #[allow(deprecated)] pub async fn new_bid( &self, opportunity: api_types::opportunity::OpportunitySvm, @@ -704,7 +703,7 @@ impl Client { tokens, fee_token, router_account, - referral_fee_bps, + referral_fee_ppm, token_account_initialization_configs, memo, .. @@ -756,7 +755,7 @@ impl Client { fee_token_program, router_account, fee_receiver_relayer: params.fee_receiver_relayer, - referral_fee_bps, + referral_fee_ppm, chain_id: opportunity_params.chain_id.clone(), configs: token_account_initialization_configs.clone(), }, diff --git a/sdk/rust/src/svm.rs b/sdk/rust/src/svm.rs index 23ad4c604..e0fc49fd9 100644 --- a/sdk/rust/src/svm.rs +++ b/sdk/rust/src/svm.rs @@ -8,7 +8,6 @@ use { }, state::{ ExpressRelayMetadata, - FEE_BPS_TO_PPM, FEE_SPLIT_PRECISION_PPM, SEED_METADATA, }, @@ -137,7 +136,7 @@ struct OpportunitySwapData<'a> { fee_token: &'a ApiFeeToken, router_account: &'a Pubkey, referral_fee_ppm: &'a u64, - platform_fee_bps: &'a u64, + platform_fee_ppm: &'a u64, } pub struct GetSwapCreateAccountsIdempotentInstructionsParams { pub searcher: Pubkey, @@ -150,7 +149,7 @@ pub struct GetSwapCreateAccountsIdempotentInstructionsParams { pub fee_token_program: Pubkey, pub router_account: Pubkey, pub fee_receiver_relayer: Pubkey, - pub referral_fee_bps: u16, + pub referral_fee_ppm: u64, pub chain_id: String, pub configs: TokenAccountInitializationConfigs, } @@ -303,7 +302,6 @@ impl Svm { .collect() } - #[allow(deprecated)] fn extract_swap_data( opportunity_params: &OpportunityParamsSvm, ) -> Result { @@ -315,7 +313,7 @@ impl Svm { fee_token, referral_fee_ppm, router_account, - platform_fee_bps, + platform_fee_ppm, .. } => Ok(OpportunitySwapData { user: user_wallet_address, @@ -323,7 +321,7 @@ impl Svm { fee_token, router_account, referral_fee_ppm, - platform_fee_bps, + platform_fee_ppm, }), _ => Err(ClientError::SvmError( "Invalid opportunity program".to_string(), @@ -424,7 +422,7 @@ impl Svm { amount_searcher, amount_user, referral_fee_ppm: *swap_data.referral_fee_ppm, - swap_platform_fee_ppm: *swap_data.platform_fee_bps * FEE_BPS_TO_PPM, + swap_platform_fee_ppm: *swap_data.platform_fee_ppm, fee_token, }; @@ -513,7 +511,7 @@ impl Svm { (QuoteTokens::SearcherTokenSpecified { .. }, ApiFeeToken::UserToken) => { let denominator = FEE_SPLIT_PRECISION_PPM - *swap_data.referral_fee_ppm - - *swap_data.platform_fee_bps * FEE_BPS_TO_PPM; + - *swap_data.platform_fee_ppm; let numerator = bid_amount * FEE_SPLIT_PRECISION_PPM; numerator.div_ceil(denominator) } From 352340ee8441613aa88e05087e78fdc32f15ec2a Mon Sep 17 00:00:00 2001 From: --systemdf Date: Tue, 1 Jul 2025 16:59:43 -0500 Subject: [PATCH 3/5] cleanup --- Cargo.lock | 4 ++-- auction-server/Cargo.toml | 2 +- auction-server/api-types/Cargo.toml | 2 +- auction-server/api-types/src/opportunity.rs | 2 +- sdk/rust/Cargo.toml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5addc0237..d9aee0b4f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -653,7 +653,7 @@ dependencies = [ [[package]] name = "auction-server" -version = "0.33.0" +version = "0.34.0" dependencies = [ "anchor-lang", "anchor-lang-idl", @@ -1937,7 +1937,7 @@ dependencies = [ [[package]] name = "express-relay-api-types" -version = "0.12.0" +version = "0.12.1" dependencies = [ "base64 0.22.1", "bincode", diff --git a/auction-server/Cargo.toml b/auction-server/Cargo.toml index 959f72375..14de2f52d 100644 --- a/auction-server/Cargo.toml +++ b/auction-server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "auction-server" -version = "0.33.0" +version = "0.34.0" edition = "2021" license-file = "license.txt" diff --git a/auction-server/api-types/Cargo.toml b/auction-server/api-types/Cargo.toml index 3c43be93e..35309d2df 100644 --- a/auction-server/api-types/Cargo.toml +++ b/auction-server/api-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "express-relay-api-types" -version = "0.12.0" +version = "0.12.1" edition = "2021" description = "Pyth Express Relay api types" repository = "https://github.com/pyth-network/per" diff --git a/auction-server/api-types/src/opportunity.rs b/auction-server/api-types/src/opportunity.rs index 19b540fe6..c7bfb887a 100644 --- a/auction-server/api-types/src/opportunity.rs +++ b/auction-server/api-types/src/opportunity.rs @@ -228,7 +228,7 @@ pub enum OpportunityParamsV1ProgramSvm { #[deprecated = "This field is deprecated and will be removed in a future release."] // TODO this should be deleted /// The referral fee in basis points. - #[schema(example = 10, deprecated)] + #[schema(example = 10)] referral_fee_bps: u16, /// The referral fee in parts per million. diff --git a/sdk/rust/Cargo.toml b/sdk/rust/Cargo.toml index a2424a22e..a9c3c0491 100644 --- a/sdk/rust/Cargo.toml +++ b/sdk/rust/Cargo.toml @@ -7,7 +7,7 @@ repository = "https://github.com/pyth-network/per" license = "Apache-2.0" [dependencies] -express-relay-api-types = { version = "0.12.0", path = "../../auction-server/api-types" } +express-relay-api-types = { version = "0.12.1", path = "../../auction-server/api-types" } reqwest = { version = "0.12.9", features = ["json"] } url = { workspace = true} serde = { workspace = true } From 2d7b5001b9c43c70351d922cf446c2ef75214e18 Mon Sep 17 00:00:00 2001 From: --systemdf Date: Wed, 2 Jul 2025 12:05:56 -0500 Subject: [PATCH 4/5] address comments --- Cargo.lock | 2 +- auction-server/src/opportunity/service/mod.rs | 33 +++++++------------ sdk/rust/Cargo.toml | 2 +- 3 files changed, 14 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d9aee0b4f..55dd5e23d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1956,7 +1956,7 @@ dependencies = [ [[package]] name = "express-relay-client" -version = "0.13.0" +version = "0.14.0" dependencies = [ "borsh 1.5.5", "express-relay", diff --git a/auction-server/src/opportunity/service/mod.rs b/auction-server/src/opportunity/service/mod.rs index 3bdc1d750..556899056 100644 --- a/auction-server/src/opportunity/service/mod.rs +++ b/auction-server/src/opportunity/service/mod.rs @@ -264,27 +264,18 @@ impl ConfigSvm { } pub fn get_platform_fee_ppm(&self, mint_user: &Pubkey, mint_searcher: &Pubkey) -> Option { - let fee_user = self.minimum_platform_fee_list.iter().find_map(|fee| { - if &fee.mint == mint_user { - Some(fee.fee_ppm) - } else { - None - } - }); - let fee_searcher = self.minimum_platform_fee_list.iter().find_map(|fee| { - if &fee.mint == mint_searcher { - Some(fee.fee_ppm) - } else { - None - } - }); - - match (fee_user, fee_searcher) { - (Some(user_fee), Some(searcher_fee)) => Some(max(user_fee, searcher_fee)), - (Some(user_fee), None) => Some(user_fee), - (None, Some(searcher_fee)) => Some(searcher_fee), - (None, None) => None, - } + let fee_user = self + .minimum_platform_fee_list + .iter() + .find(|fee| &fee.mint == mint_user) + .map(|fee| fee.fee_ppm); + let fee_searcher = self + .minimum_platform_fee_list + .iter() + .find(|fee| &fee.mint == mint_searcher) + .map(|fee| fee.fee_ppm); + + fee_user.into_iter().chain(fee_searcher).max() } } diff --git a/sdk/rust/Cargo.toml b/sdk/rust/Cargo.toml index a9c3c0491..541a5b06c 100644 --- a/sdk/rust/Cargo.toml +++ b/sdk/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "express-relay-client" -version = "0.13.0" +version = "0.14.0" edition = "2021" description = "Pyth Express Relay client" repository = "https://github.com/pyth-network/per" From 0f994640a2b2d0b9d03047847f922c3010c6f597 Mon Sep 17 00:00:00 2001 From: --systemdf Date: Wed, 2 Jul 2025 12:23:19 -0500 Subject: [PATCH 5/5] fix request format in test swap --- tilt-scripts/svm/test_swap.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tilt-scripts/svm/test_swap.py b/tilt-scripts/svm/test_swap.py index 7a25ea4d0..bb67fec50 100644 --- a/tilt-scripts/svm/test_swap.py +++ b/tilt-scripts/svm/test_swap.py @@ -60,11 +60,16 @@ async def send_and_submit_quote( logger.info("Taker pubkey: %s", pk_taker) payload = { "chain_id": chain_id, - "input_token_mint": input_token, - "output_token_mint": output_token, - "router": "3hv8L8UeBbyM3M25dF3h2C5p8yA4FptD7FFZu4Z1jCMn", - "referral_fee_bps": 10, - "specified_token_amount": {"amount": random.randint(1, 1000), "side": side}, + "input_token_mint": output_token, + "output_token_mint": input_token, + "referral_fee_info": { + "referral_fee_ppm": 1000, + "router": "3hv8L8UeBbyM3M25dF3h2C5p8yA4FptD7FFZu4Z1jCMn", + }, + "specified_token_amount": { + "amount": random.randint(100001, 1000000), + "side": side, + }, "user_wallet_address": str(pk_taker), "memo": "memo", "version": "v1",