diff --git a/crates/swapper/src/across/provider.rs b/crates/swapper/src/across/provider.rs index 0e38dded3..73cc7ba7a 100644 --- a/crates/swapper/src/across/provider.rs +++ b/crates/swapper/src/across/provider.rs @@ -498,7 +498,6 @@ impl Swapper for Across { input: input_asset.clone(), output: output_asset.clone(), route_data, - gas_limit: Some(DEFAULT_DEPOSIT_GAS_LIMIT.to_string()), }], }, request: request.clone(), @@ -551,7 +550,7 @@ impl Swapper for Across { }; let to: String = deployment.spoke_pool.into(); - let mut gas_limit = if approval.is_some() { route.gas_limit.clone() } else { None }; + let mut gas_limit = if approval.is_some() { Some(DEFAULT_DEPOSIT_GAS_LIMIT.to_string()) } else { None }; if matches!(data, FetchQuoteData::EstimateGas) { let hex_value = format!("{:#x}", U256::from_str(value).unwrap()); diff --git a/crates/swapper/src/chainflip/provider.rs b/crates/swapper/src/chainflip/provider.rs index 3a730e9a9..5d9062a70 100644 --- a/crates/swapper/src/chainflip/provider.rs +++ b/crates/swapper/src/chainflip/provider.rs @@ -193,7 +193,6 @@ where input: request.from_asset.asset_id(), output: request.to_asset.asset_id(), route_data: serde_json::to_string(&route_data).unwrap(), - gas_limit: None, }], }, eta_in_seconds: Some(eta_in_seconds), diff --git a/crates/swapper/src/hyperliquid/provider/bridge.rs b/crates/swapper/src/hyperliquid/provider/bridge.rs index 061cdeef1..582765191 100644 --- a/crates/swapper/src/hyperliquid/provider/bridge.rs +++ b/crates/swapper/src/hyperliquid/provider/bridge.rs @@ -61,7 +61,6 @@ impl Swapper for HyperCoreBridge { input: request.from_asset.asset_id(), output: request.to_asset.asset_id(), route_data: "".to_string(), - gas_limit: None, }], }, request: request.clone(), diff --git a/crates/swapper/src/hyperliquid/provider/spot/provider.rs b/crates/swapper/src/hyperliquid/provider/spot/provider.rs index 7a6c27250..fc336e673 100644 --- a/crates/swapper/src/hyperliquid/provider/spot/provider.rs +++ b/crates/swapper/src/hyperliquid/provider/spot/provider.rs @@ -229,7 +229,6 @@ impl Swapper for HyperCoreSpot { }), )) .map_err(|err| SwapperError::ComputeQuoteError(err.to_string()))?, - gas_limit: None, }], }, request: request.clone(), diff --git a/crates/swapper/src/jupiter/provider.rs b/crates/swapper/src/jupiter/provider.rs index fb475822a..d00cfe119 100644 --- a/crates/swapper/src/jupiter/provider.rs +++ b/crates/swapper/src/jupiter/provider.rs @@ -152,7 +152,6 @@ where input: AssetId::from(Chain::Solana, Some(input_mint)), output: AssetId::from(Chain::Solana, Some(output_mint)), route_data: serde_json::to_string(&swap_quote).unwrap_or_default(), - gas_limit: None, }], slippage_bps: swap_quote.slippage_bps, }, diff --git a/crates/swapper/src/models.rs b/crates/swapper/src/models.rs index d93a9be5e..53397fb4b 100644 --- a/crates/swapper/src/models.rs +++ b/crates/swapper/src/models.rs @@ -142,7 +142,6 @@ pub struct Route { pub input: AssetId, pub output: AssetId, pub route_data: String, - pub gas_limit: Option, } #[derive(Debug, Clone, PartialEq)] diff --git a/crates/swapper/src/near_intents/provider.rs b/crates/swapper/src/near_intents/provider.rs index 5679a7e3c..79979dc87 100644 --- a/crates/swapper/src/near_intents/provider.rs +++ b/crates/swapper/src/near_intents/provider.rs @@ -306,7 +306,6 @@ where input: request.from_asset.asset_id(), output: request.to_asset.asset_id(), route_data, - gas_limit: None, }], }, request: request.clone(), diff --git a/crates/swapper/src/proxy/provider.rs b/crates/swapper/src/proxy/provider.rs index 83ae725ed..a8298b7e1 100644 --- a/crates/swapper/src/proxy/provider.rs +++ b/crates/swapper/src/proxy/provider.rs @@ -209,7 +209,6 @@ where input: request.from_asset.asset_id(), output: request.to_asset.asset_id(), route_data: serde_json::to_string("e).map_err(|e| SwapperError::ComputeQuoteError(e.to_string()))?, - gas_limit: None, }], slippage_bps: request.options.slippage.bps, }, diff --git a/crates/swapper/src/relay/provider.rs b/crates/swapper/src/relay/provider.rs index 37bb465ad..79e2ddbae 100644 --- a/crates/swapper/src/relay/provider.rs +++ b/crates/swapper/src/relay/provider.rs @@ -103,7 +103,6 @@ where input: from_asset_id, output: to_asset_id, route_data: serde_json::to_string(&response).map_err(|e| SwapperError::ComputeQuoteError(e.to_string()))?, - gas_limit: None, }], slippage_bps: response.details.slippage_bps().unwrap_or(request.options.slippage.bps), }, diff --git a/crates/swapper/src/thorchain/provider.rs b/crates/swapper/src/thorchain/provider.rs index 97f27f451..12c011083 100644 --- a/crates/swapper/src/thorchain/provider.rs +++ b/crates/swapper/src/thorchain/provider.rs @@ -140,7 +140,6 @@ where input: request.from_asset.asset_id(), output: request.to_asset.asset_id(), route_data: serde_json::to_string(&route_data).unwrap_or_default(), - gas_limit: None, }], slippage_bps: request.options.slippage.bps, }, diff --git a/crates/swapper/src/uniswap/quote_result.rs b/crates/swapper/src/uniswap/quote_result.rs index 46fafb57e..44edb492c 100644 --- a/crates/swapper/src/uniswap/quote_result.rs +++ b/crates/swapper/src/uniswap/quote_result.rs @@ -7,7 +7,6 @@ pub struct QuoteResult { pub amount_out: U256, pub fee_tier_idx: usize, pub batch_idx: usize, - pub gas_estimate: Option, } pub fn get_best_quote(batch_results: &[Result, JsonRpcError>], decoder: F) -> Result @@ -28,7 +27,6 @@ where amount_out: quoter_tuple.0, fee_tier_idx: fee_idx, batch_idx, - gas_estimate: Some(quoter_tuple.1.to_string()), }), _ => None, }) diff --git a/crates/swapper/src/uniswap/swap_route.rs b/crates/swapper/src/uniswap/swap_route.rs index a95783b4d..ed11809ce 100644 --- a/crates/swapper/src/uniswap/swap_route.rs +++ b/crates/swapper/src/uniswap/swap_route.rs @@ -23,7 +23,7 @@ pub fn get_intermediaries_by_array(token_in: &Address, token_out: &Address, arra .collect() } -pub fn build_swap_route(token_in: &AssetId, intermediary: Option<&AssetId>, token_out: &AssetId, route_data: &RouteData, gas_estimate: Option) -> Vec { +pub fn build_swap_route(token_in: &AssetId, intermediary: Option<&AssetId>, token_out: &AssetId, route_data: &RouteData) -> Vec { let data = serde_json::to_string(route_data).unwrap(); if let Some(intermediary) = intermediary { vec![ @@ -31,13 +31,11 @@ pub fn build_swap_route(token_in: &AssetId, intermediary: Option<&AssetId>, toke input: token_in.clone(), output: intermediary.clone(), route_data: data.clone(), - gas_limit: gas_estimate.clone(), }, Route { input: intermediary.clone(), output: token_out.clone(), route_data: data, - gas_limit: None, }, ] } else { @@ -45,7 +43,6 @@ pub fn build_swap_route(token_in: &AssetId, intermediary: Option<&AssetId>, toke input: token_in.clone(), output: token_out.clone(), route_data: data, - gas_limit: gas_estimate.clone(), }] } } diff --git a/crates/swapper/src/uniswap/v3/provider.rs b/crates/swapper/src/uniswap/v3/provider.rs index 58f7b0f43..e8abe3e83 100644 --- a/crates/swapper/src/uniswap/v3/provider.rs +++ b/crates/swapper/src/uniswap/v3/provider.rs @@ -160,7 +160,6 @@ impl Swapper for UniswapV3 { let fee_tier_idx = quote_result.fee_tier_idx; let batch_idx = quote_result.batch_idx; - let gas_estimate = quote_result.gas_estimate; let fee_tier: u32 = fee_tiers[fee_tier_idx % fee_tiers.len()] as u32; let asset_id_in = AssetId::from(from_chain, Some(token_in.to_checksum(None))); @@ -176,7 +175,7 @@ impl Swapper for UniswapV3 { fee_tier: fee_tier.to_string(), min_amount_out: to_min_value.to_string(), }; - let routes = build_swap_route(&asset_id_in, asset_id_intermediary.as_ref(), &asset_id_out, &route_data, gas_estimate); + let routes = build_swap_route(&asset_id_in, asset_id_intermediary.as_ref(), &asset_id_out, &route_data); Ok(Quote { from_value: request.value.clone(), diff --git a/crates/swapper/src/uniswap/v4/provider.rs b/crates/swapper/src/uniswap/v4/provider.rs index 255046eeb..756d8c42d 100644 --- a/crates/swapper/src/uniswap/v4/provider.rs +++ b/crates/swapper/src/uniswap/v4/provider.rs @@ -148,7 +148,6 @@ impl Swapper for UniswapV4 { let fee_tier_idx = quote_result.fee_tier_idx; let batch_idx = quote_result.batch_idx; - let gas_estimate = quote_result.gas_estimate; let to_value = if fee_preference.is_input_token { quote_result.amount_out @@ -171,7 +170,7 @@ impl Swapper for UniswapV4 { fee_tier: fee_tier.to_string(), min_amount_out: to_min_value.to_string(), }; - let routes = build_swap_route(&asset_id_in, asset_id_intermediary.as_ref(), &asset_id_out, &route_data, gas_estimate); + let routes = build_swap_route(&asset_id_in, asset_id_intermediary.as_ref(), &asset_id_out, &route_data); Ok(Quote { from_value: request.value.clone(), diff --git a/gemstone/src/gem_swapper/remote_types.rs b/gemstone/src/gem_swapper/remote_types.rs index fb896d327..e5e58a2ac 100644 --- a/gemstone/src/gem_swapper/remote_types.rs +++ b/gemstone/src/gem_swapper/remote_types.rs @@ -89,7 +89,6 @@ pub struct SwapperRoute { pub input: AssetId, pub output: AssetId, pub route_data: String, - pub gas_limit: Option, } #[uniffi::remote(Record)] diff --git a/gemstone/tests/ios/GemTest/GemTest/Extension/Swapper+Ext.swift b/gemstone/tests/ios/GemTest/GemTest/Extension/Swapper+Ext.swift index 071d39c9f..ab3fdba6a 100644 --- a/gemstone/tests/ios/GemTest/GemTest/Extension/Swapper+Ext.swift +++ b/gemstone/tests/ios/GemTest/GemTest/Extension/Swapper+Ext.swift @@ -25,7 +25,6 @@ extension SwapperQuote: @retroactive CustomStringConvertible { "input": route.input, "output": route.output, "routeData": route.routeData, - "gasLimit": route.gasLimit ?? "", ] } let json: [String: Any] = [ @@ -51,7 +50,6 @@ extension GemSwapQuoteData: @retroactive CustomStringConvertible { "data": data, "memo": memo ?? NSNull(), "approval": NSNull(), - "gasLimit": gasLimit ?? NSNull(), ] if let approvalData = approval { json["approval"] = [