Skip to content

Commit

Permalink
add minimums
Browse files Browse the repository at this point in the history
  • Loading branch information
anthontaylor committed Nov 21, 2024
1 parent 615f848 commit 3abb2ab
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
5 changes: 2 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,8 @@ async fn main() -> Result<()> {
if let Some(update_oracle_tx) = market_data.switchboard_update_tx {
txs.insert(0, update_oracle_tx);
}
match jito_client.send_bundle(&txs).await {
Ok(v) => println!("Bundle sent successfully: {:?}", v),
Err(e) => println!("Error sending bundle: {:?}", e),
if let Err(e) = jito_client.send_bundle(&txs).await {
println!("Error sending bundle: {:?}", e)
}
}
tokio::time::sleep(Duration::from_secs(60 * 5)).await;
Expand Down
27 changes: 19 additions & 8 deletions src/strategy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,14 +215,19 @@ impl Strategy for BuyOnJupiterSellOnEtherfuse {
}
}

if best_quote.is_none() {
return Err(anyhow::anyhow!("No profitable trades found"));
}

println!("\n🏁 Search Complete");
println!("Final best profit: {}", best_profit);
println!("Final USDC amount: {}", best_usdc_amount);
println!("Final Stablebond amount: {}", best_stablebond_amount);

if best_quote.is_none() {
return Err(anyhow::anyhow!("No profitable trades found"));
}
if best_profit < 1.0 {
return Err(anyhow::anyhow!(
"All trades were less than $1.00 USD profit"
));
}
let mut txs: Vec<VersionedTransaction> = Vec::new();
if let Ok(buy_on_jupiter_tx) = self
.jupiter_client
Expand Down Expand Up @@ -369,14 +374,20 @@ impl Strategy for BuyOnEtherfuseSellOnJupiter {
}
}

if best_quote.is_none() {
return Err(anyhow::anyhow!("No profitable trades found"));
}

println!("\n🏁 Search Complete");
println!("Final best profit: {}", best_profit);
println!("Final USDC amount: {}", best_usdc_amount);
println!("Final Stablebond amount: {}", best_stablebond_amount);

if best_quote.is_none() {
return Err(anyhow::anyhow!("No profitable trades found"));
}

if best_profit < 1.0 {
return Err(anyhow::anyhow!(
"All trades were less than $1.00 USD profit"
));
}
let mut txs: Vec<VersionedTransaction> = Vec::new();
if let Ok(buy_on_etherfuse_tx) = self
.etherfuse_client
Expand Down

0 comments on commit 3abb2ab

Please sign in to comment.