19
19
fs,
20
20
time:: Duration ,
21
21
} ,
22
+ uuid:: Uuid ,
22
23
} ;
23
24
24
25
pub mod server;
@@ -150,33 +151,39 @@ pub enum Config {
150
151
pub struct ConfigSvm {
151
152
/// Id of the express relay program.
152
153
#[ serde_as( as = "DisplayFromStr" ) ]
153
- pub express_relay_program_id : Pubkey ,
154
+ pub express_relay_program_id : Pubkey ,
154
155
/// RPC endpoint to use for reading from the blockchain.
155
- pub rpc_read_url : String ,
156
+ pub rpc_read_url : String ,
156
157
/// RPC endpoint to use for broadcasting transactions
157
- pub rpc_tx_submission_urls : Vec < String > ,
158
+ pub rpc_tx_submission_urls : Vec < String > ,
158
159
/// WS endpoint to use for interacting with the blockchain.
159
- pub ws_addr : String ,
160
+ pub ws_addr : String ,
160
161
/// Timeout for RPC requests in seconds.
161
162
#[ serde( default = "ConfigSvm::default_rpc_timeout_svm" ) ]
162
- pub rpc_timeout : u64 ,
163
+ pub rpc_timeout : u64 ,
163
164
#[ serde( default ) ]
164
165
/// Percentile of prioritization fees to query from the `rpc_read_url`.
165
166
/// This should be None unless the RPC `getRecentPrioritizationFees`'s supports the percentile parameter, for example Triton RPC.
166
167
/// It is an integer between 0 and 10000 with 10000 representing 100%.
167
- pub prioritization_fee_percentile : Option < u64 > ,
168
+ pub prioritization_fee_percentile : Option < u64 > ,
168
169
/// List of accepted token programs for the swap instruction.
169
170
#[ serde_as( as = "Vec<DisplayFromStr>" ) ]
170
- pub accepted_token_programs : Vec < Pubkey > ,
171
+ pub accepted_token_programs : Vec < Pubkey > ,
171
172
/// Ordered list of fee tokens, with first being the most preferred.
172
173
#[ serde_as( as = "Vec<DisplayFromStr>" ) ]
173
- pub ordered_fee_tokens : Vec < Pubkey > ,
174
+ pub ordered_fee_tokens : Vec < Pubkey > ,
174
175
/// Whitelisted token mints
175
176
#[ serde( default ) ]
176
- pub token_whitelist : TokenWhitelistConfig ,
177
+ pub token_whitelist : TokenWhitelistConfig ,
178
+ /// Minimum fee list
179
+ #[ serde( default ) ]
180
+ pub minimum_fee_list : MinimumFeeListConfig ,
181
+ /// Whether to allow permissionless quote requests.
182
+ #[ serde( default ) ]
183
+ pub allow_permissionless_quote_requests : bool ,
177
184
/// Auction time for the chain (how long to wait before choosing winning bids)
178
185
#[ serde( default = "ConfigSvm::default_auction_time" , with = "humantime_serde" ) ]
179
- pub auction_time : Duration ,
186
+ pub auction_time : Duration ,
180
187
}
181
188
182
189
impl ConfigSvm {
@@ -199,3 +206,25 @@ pub struct TokenWhitelistConfig {
199
206
#[ serde_as( as = "Vec<DisplayFromStr>" ) ]
200
207
pub whitelist_mints : Vec < Pubkey > ,
201
208
}
209
+
210
+ /// Optional minimum fee list to determine validity of quote request
211
+ #[ serde_as]
212
+ #[ derive( Clone , Debug , Default , serde:: Serialize , serde:: Deserialize ) ]
213
+ pub struct MinimumFeeListConfig {
214
+ #[ serde( default ) ]
215
+ pub profiles : Vec < MinimumFeeProfile > ,
216
+ }
217
+
218
+ #[ derive( Clone , Debug , Default , serde:: Serialize , serde:: Deserialize ) ]
219
+ pub struct MinimumFeeProfile {
220
+ pub profile_id : Option < Uuid > ,
221
+ pub minimum_fees : Vec < MinimumFee > ,
222
+ }
223
+
224
+ #[ serde_as]
225
+ #[ derive( Clone , Debug , Default , serde:: Serialize , serde:: Deserialize ) ]
226
+ pub struct MinimumFee {
227
+ #[ serde_as( as = "DisplayFromStr" ) ]
228
+ pub mint : Pubkey ,
229
+ pub fee_ppm : u64 ,
230
+ }
0 commit comments