@@ -2,7 +2,7 @@ use clap::{Args, Parser, Subcommand};
22use tycho_common:: { models:: Chain , Bytes } ;
33use tycho_ethereum:: rpc:: { config:: RPCRetryConfig , EthereumRpcClient } ;
44
5- use crate :: { extractor:: ExtractionError , services :: ServerRpcConfig } ;
5+ use crate :: extractor:: ExtractionError ;
66
77/// Tycho Indexer using Substreams
88///
@@ -79,10 +79,6 @@ pub struct GlobalArgs {
7979 /// RPC configuration (URL and retry settings)
8080 #[ command( flatten) ]
8181 pub rpc : RPCArgs ,
82-
83- /// Tycho RPC server configuration (minimum filtering thresholds)
84- #[ command( flatten) ]
85- pub server : ServerArgs ,
8682}
8783
8884/// RPC configuration arguments (url, retry settings, and potentially others, such as batching)
@@ -105,38 +101,6 @@ pub struct RPCArgs {
105101 pub max_backoff_ms : u64 ,
106102}
107103
108- /// Tycho RPC server configuration (minimum filtering thresholds)
109- #[ derive( Args , Debug , Clone , PartialEq ) ]
110- pub struct ServerArgs {
111- /// Minimum TVL threshold for RPC responses (in chain's native token)
112- /// Components requests with TVL below this value or with no TVL will be rejected
113- #[ clap( long = "rpc-min-tvl" , env = "RPC_MIN_TVL" ) ]
114- pub min_tvl : Option < f64 > ,
115-
116- /// Minimum token quality threshold for RPC responses
117- /// Tokens requests with quality below this value will be rejected
118- #[ clap( long = "rpc-min-token-quality" , env = "RPC_MIN_TOKEN_QUALITY" ) ]
119- pub min_token_quality : Option < i32 > ,
120-
121- /// Maximum traded_n_days_ago threshold for RPC responses
122- /// Tokens requests with traded_n_days_ago above this value will be rejected
123- #[ clap(
124- long = "rpc-max-traded-n-days-ago" ,
125- env = "RPC_MAX_TRADED_N_DAYS_AGO" ,
126- alias = "rpc-min-traded-n-days-ago" // to ensure backward compatibility, TODO: remove after next prod release
127- ) ]
128- pub max_traded_n_days_ago : Option < u64 > ,
129- }
130-
131- impl From < ServerArgs > for ServerRpcConfig {
132- fn from ( args : ServerArgs ) -> Self {
133- Self :: new ( )
134- . with_min_tvl ( args. min_tvl )
135- . with_min_quality ( args. min_token_quality )
136- . with_max_traded_n_days_ago ( args. max_traded_n_days_ago )
137- }
138- }
139-
140104impl RPCArgs {
141105 pub fn build_client ( & self ) -> Result < EthereumRpcClient , ExtractionError > {
142106 let retry_config =
@@ -314,11 +278,6 @@ mod cli_tests {
314278 initial_backoff_ms : 150 ,
315279 max_backoff_ms : 5000 ,
316280 } ,
317- server : ServerArgs {
318- min_tvl : None ,
319- min_token_quality : None ,
320- max_traded_n_days_ago : None ,
321- } ,
322281 } ,
323282 command : Command :: Run ( RunSpkgArgs {
324283 chain : "ethereum" . to_string ( ) ,
@@ -381,11 +340,6 @@ mod cli_tests {
381340 initial_backoff_ms : 200 ,
382341 max_backoff_ms : 10000 ,
383342 } ,
384- server : ServerArgs {
385- min_tvl : None ,
386- min_token_quality : None ,
387- max_traded_n_days_ago : None ,
388- } ,
389343 } ,
390344 command : Command :: Index ( IndexArgs {
391345 substreams_args : SubstreamsArgs {
0 commit comments