From 7b984231a21a9ef44029a041221f0903e9de49a5 Mon Sep 17 00:00:00 2001 From: vibes Date: Wed, 7 Jan 2026 14:52:07 +0000 Subject: [PATCH] Fix Soyas client to match other SWQOS clients MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously Soyas returned early on successful send without: - Any logging - Polling for transaction confirmation Now aligned with other SWQOS clients (zeroslot, lightspeed, etc.): - Proper error handling with reconnect retry - Always poll for transaction confirmation - Log confirmation success/failure with elapsed time 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/swqos/soyas.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/swqos/soyas.rs b/src/swqos/soyas.rs index ec4880b..e1658e2 100644 --- a/src/swqos/soyas.rs +++ b/src/swqos/soyas.rs @@ -104,18 +104,19 @@ impl SwqosClientTrait for SoyasClient { transaction: &VersionedTransaction, wait_confirmation: bool, ) -> Result<()> { + let start_time = Instant::now(); let signature = transaction.get_signature(); let serialized_tx = bincode::serialize(transaction)?; let connection = self.connection.load_full(); - if Self::try_send_bytes(&connection, &serialized_tx).await.is_ok() { - return Ok(()); + if Self::try_send_bytes(&connection, &serialized_tx).await.is_err() { + eprintln!(" [soyas] {} submission failed, reconnecting", trade_type); + self.reconnect().await?; + let connection = self.connection.load_full(); + if let Err(e) = Self::try_send_bytes(&connection, &serialized_tx).await { + eprintln!(" [soyas] {} submission failed: {:?}", trade_type, e); + return Err(e.into()); + } } - eprintln!(" [soyas] failed to send transaction; reconnecting"); - self.reconnect().await?; - let connection = self.connection.load_full(); - Self::try_send_bytes(&connection, &serialized_tx).await?; - - let start_time: Instant = Instant::now(); match poll_transaction_confirmation(&self.rpc_client, *signature, wait_confirmation).await { Ok(_) => (), Err(e) => {