diff --git a/Cargo.lock b/Cargo.lock index 6bc856e9c..ba274e8ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3941,6 +3941,7 @@ dependencies = [ "env_logger 0.11.8", "log", "rustls 0.23.27", + "solana-instruction", "tokio", "yellowstone-grpc-proto", ] @@ -3956,6 +3957,8 @@ dependencies = [ "dotenv", "env_logger 0.11.8", "log", + "solana-account", + "solana-instruction", "tokio", "yellowstone-grpc-proto", ] @@ -4198,6 +4201,7 @@ dependencies = [ "dotenv", "env_logger 0.11.8", "solana-commitment-config", + "solana-instruction", "tokio", ] @@ -4315,6 +4319,7 @@ dependencies = [ "env_logger 0.11.8", "log", "solana-client", + "solana-instruction", "tokio", ] @@ -4616,6 +4621,7 @@ dependencies = [ "env_logger 0.11.8", "log", "solana-client", + "solana-instruction", "tokio", ] @@ -5382,6 +5388,8 @@ dependencies = [ "env_logger 0.11.8", "log", "rustls 0.23.27", + "solana-account", + "solana-instruction", "tokio", "yellowstone-grpc-proto", ] @@ -5399,6 +5407,7 @@ dependencies = [ "env_logger 0.11.8", "log", "solana-client", + "solana-instruction", "tokio", ] @@ -5415,6 +5424,7 @@ dependencies = [ "env_logger 0.11.8", "log", "solana-client", + "solana-instruction", "tokio", ] @@ -9672,6 +9682,7 @@ dependencies = [ "juniper", "log", "rustls 0.23.27", + "solana-account", "spl-token 6.0.0", "tokio", "yellowstone-grpc-proto", diff --git a/crates/core/src/account.rs b/crates/core/src/account.rs index 08d989b5a..75787faff 100644 --- a/crates/core/src/account.rs +++ b/crates/core/src/account.rs @@ -125,7 +125,8 @@ pub trait AccountDecoder<'a> { /// The input type for the account processor. /// /// - `T`: The account type, as determined by the decoder. -pub type AccountProcessorInputType = (AccountMetadata, DecodedAccount); +pub type AccountProcessorInputType = + (AccountMetadata, DecodedAccount, solana_account::Account); /// A processing pipe that decodes and processes Solana account updates. /// @@ -207,7 +208,14 @@ impl AccountPipes for AccountPipe { if let Some(decoded_account) = self.decoder.decode_account(&account_with_metadata.1) { self.processor - .process((account_with_metadata.0, decoded_account), metrics) + .process( + ( + account_with_metadata.0.clone(), + decoded_account, + account_with_metadata.1, + ), + metrics.clone(), + ) .await?; } Ok(()) diff --git a/crates/core/src/instruction.rs b/crates/core/src/instruction.rs index 79158bef2..a772b09c8 100644 --- a/crates/core/src/instruction.rs +++ b/crates/core/src/instruction.rs @@ -118,6 +118,7 @@ pub type InstructionProcessorInputType = ( InstructionMetadata, DecodedInstruction, NestedInstructions, + solana_instruction::Instruction, ); /// A processing pipeline for instructions, using a decoder and processor. @@ -182,6 +183,7 @@ impl InstructionPipes<'_> for InstructionPipe { nested_instruction.metadata.clone(), decoded_instruction, nested_instruction.inner_instructions.clone(), + nested_instruction.instruction.clone(), ), metrics.clone(), ) diff --git a/examples/block-crawler/src/main.rs b/examples/block-crawler/src/main.rs index 3f24ac5b1..4c77ad7ff 100644 --- a/examples/block-crawler/src/main.rs +++ b/examples/block-crawler/src/main.rs @@ -66,7 +66,7 @@ impl Processor for PumpfunInstructionProcessor { data: Self::InputType, _metrics: Arc, ) -> CarbonResult<()> { - let (metadata, pumpfun_instruction, _) = data; + let (metadata, pumpfun_instruction, _nested_instructions, _) = data; match pumpfun_instruction.data { PumpfunInstruction::CreateEvent(create_event) => { diff --git a/examples/jupiter-swap-alerts/Cargo.toml b/examples/jupiter-swap-alerts/Cargo.toml index 0192b6fb2..e1a8157e6 100644 --- a/examples/jupiter-swap-alerts/Cargo.toml +++ b/examples/jupiter-swap-alerts/Cargo.toml @@ -13,6 +13,7 @@ async-trait = { workspace = true } dotenv = { workspace = true } env_logger = { workspace = true } log = { workspace = true } +solana-instruction = { workspace = true } tokio = { workspace = true, features = ["full"] } yellowstone-grpc-proto = { workspace = true } diff --git a/examples/jupiter-swap-alerts/src/main.rs b/examples/jupiter-swap-alerts/src/main.rs index 4e2734bc2..832be8f9f 100644 --- a/examples/jupiter-swap-alerts/src/main.rs +++ b/examples/jupiter-swap-alerts/src/main.rs @@ -79,10 +79,11 @@ impl Processor for JupiterSwapInstructionProcessor { InstructionMetadata, DecodedInstruction, NestedInstructions, + solana_instruction::Instruction, ); async fn process( &mut self, - (metadata, instruction, nested_instructions): Self::InputType, + (metadata, instruction, nested_instructions, _): Self::InputType, _metrics: Arc, ) -> CarbonResult<()> { let signature = metadata.transaction_metadata.signature; diff --git a/examples/kamino-alerts/Cargo.toml b/examples/kamino-alerts/Cargo.toml index d10f15cee..d9b804d14 100644 --- a/examples/kamino-alerts/Cargo.toml +++ b/examples/kamino-alerts/Cargo.toml @@ -13,5 +13,7 @@ async-trait = { workspace = true } dotenv = { workspace = true } env_logger = { workspace = true } log = { workspace = true } +solana-account = { workspace = true } +solana-instruction = { workspace = true } tokio = { workspace = true, features = ["full"] } yellowstone-grpc-proto = { workspace = true } diff --git a/examples/kamino-alerts/src/main.rs b/examples/kamino-alerts/src/main.rs index fdca7345d..510247643 100644 --- a/examples/kamino-alerts/src/main.rs +++ b/examples/kamino-alerts/src/main.rs @@ -83,11 +83,12 @@ impl Processor for KaminoLendingInstructionProcessor { InstructionMetadata, DecodedInstruction, NestedInstructions, + solana_instruction::Instruction, ); async fn process( &mut self, - (metadata, instruction, _nested_instructions): Self::InputType, + (metadata, instruction, _nested_instructions, _): Self::InputType, _metrics: Arc, ) -> CarbonResult<()> { let signature = metadata.transaction_metadata.signature; @@ -111,7 +112,11 @@ impl Processor for KaminoLendingInstructionProcessor { pub struct KaminoLendingAccountProcessor; #[async_trait] impl Processor for KaminoLendingAccountProcessor { - type InputType = (AccountMetadata, DecodedAccount); + type InputType = ( + AccountMetadata, + DecodedAccount, + solana_account::Account, + ); async fn process( &mut self, diff --git a/examples/meteora-activities/Cargo.toml b/examples/meteora-activities/Cargo.toml index e4dce66d4..092e7112b 100644 --- a/examples/meteora-activities/Cargo.toml +++ b/examples/meteora-activities/Cargo.toml @@ -13,4 +13,5 @@ solana-commitment-config = { workspace = true } async-trait = { workspace = true } dotenv = { workspace = true } env_logger = { workspace = true } +solana-instruction = { workspace = true } tokio = { workspace = true, features = ["full"] } diff --git a/examples/meteora-activities/src/main.rs b/examples/meteora-activities/src/main.rs index 386d731d4..a1c3c321e 100644 --- a/examples/meteora-activities/src/main.rs +++ b/examples/meteora-activities/src/main.rs @@ -52,6 +52,7 @@ impl Processor for MeteoraInstructionProcessor { InstructionMetadata, DecodedInstruction, NestedInstructions, + solana_instruction::Instruction, ); async fn process( @@ -59,7 +60,7 @@ impl Processor for MeteoraInstructionProcessor { data: Self::InputType, _metrics: Arc, ) -> CarbonResult<()> { - let (_instruction_metadata, decoded_instruction, _nested_instructions) = data; + let (_instruction_metadata, decoded_instruction, _nested_instructions, _) = data; // Process all Meteora Events and add each to DB match decoded_instruction.data { diff --git a/examples/moonshot-alerts/Cargo.toml b/examples/moonshot-alerts/Cargo.toml index 4558f34a4..b7c6758c6 100644 --- a/examples/moonshot-alerts/Cargo.toml +++ b/examples/moonshot-alerts/Cargo.toml @@ -14,4 +14,5 @@ async-trait = { workspace = true } dotenv = { workspace = true } env_logger = { workspace = true } log = { workspace = true } +solana-instruction = { workspace = true } tokio = { workspace = true, features = ["full"] } diff --git a/examples/moonshot-alerts/src/main.rs b/examples/moonshot-alerts/src/main.rs index dd5530df2..5223c01ae 100644 --- a/examples/moonshot-alerts/src/main.rs +++ b/examples/moonshot-alerts/src/main.rs @@ -60,11 +60,12 @@ impl Processor for MoonshotInstructionProcessor { InstructionMetadata, DecodedInstruction, NestedInstructions, + solana_instruction::Instruction, ); async fn process( &mut self, - (metadata, instruction, _nested_instructions): Self::InputType, + (metadata, instruction, _nested_instructions, _): Self::InputType, _metrics: Arc, ) -> CarbonResult<()> { let signature = metadata.transaction_metadata.signature; diff --git a/examples/openbook-v2-alerts/Cargo.toml b/examples/openbook-v2-alerts/Cargo.toml index bae060eff..e04e5a294 100644 --- a/examples/openbook-v2-alerts/Cargo.toml +++ b/examples/openbook-v2-alerts/Cargo.toml @@ -14,4 +14,5 @@ async-trait = { workspace = true } dotenv = { workspace = true } env_logger = { workspace = true } log = { workspace = true } +solana-instruction = { workspace = true } tokio = { workspace = true, features = ["full"] } diff --git a/examples/openbook-v2-alerts/src/main.rs b/examples/openbook-v2-alerts/src/main.rs index 33ccace47..528cb1fea 100644 --- a/examples/openbook-v2-alerts/src/main.rs +++ b/examples/openbook-v2-alerts/src/main.rs @@ -56,11 +56,12 @@ impl Processor for OpenbookV2InstructionProcessor { InstructionMetadata, DecodedInstruction, NestedInstructions, + solana_instruction::Instruction, ); async fn process( &mut self, - (metadata, instruction, _nested_instructions): Self::InputType, + (metadata, instruction, _nested_instructions, _): Self::InputType, _metrics: Arc, ) -> CarbonResult<()> { let signature = metadata.transaction_metadata.signature; diff --git a/examples/raydium-alerts/Cargo.toml b/examples/raydium-alerts/Cargo.toml index 36b34b2f5..95a40ad01 100644 --- a/examples/raydium-alerts/Cargo.toml +++ b/examples/raydium-alerts/Cargo.toml @@ -13,6 +13,8 @@ async-trait = { workspace = true } dotenv = { workspace = true } env_logger = { workspace = true } log = { workspace = true } +solana-account = { workspace = true } +solana-instruction = { workspace = true } tokio = { workspace = true, features = ["full"] } yellowstone-grpc-proto = { workspace = true } diff --git a/examples/raydium-alerts/src/main.rs b/examples/raydium-alerts/src/main.rs index 85a72a79e..4b1093918 100644 --- a/examples/raydium-alerts/src/main.rs +++ b/examples/raydium-alerts/src/main.rs @@ -95,11 +95,12 @@ impl Processor for RaydiumAmmV4InstructionProcessor { InstructionMetadata, DecodedInstruction, NestedInstructions, + solana_instruction::Instruction, ); async fn process( &mut self, - (metadata, instruction, _nested_instructions): Self::InputType, + (metadata, instruction, _nested_instructions, _): Self::InputType, _metrics: Arc, ) -> CarbonResult<()> { let signature = metadata.transaction_metadata.signature; @@ -195,7 +196,11 @@ impl Processor for RaydiumAmmV4InstructionProcessor { pub struct RaydiumAmmV4AccountProcessor; #[async_trait] impl Processor for RaydiumAmmV4AccountProcessor { - type InputType = (AccountMetadata, DecodedAccount); + type InputType = ( + AccountMetadata, + DecodedAccount, + solana_account::Account, + ); async fn process( &mut self, diff --git a/examples/raydium-clmm-alerts/Cargo.toml b/examples/raydium-clmm-alerts/Cargo.toml index ca4ed9526..6a36276a1 100644 --- a/examples/raydium-clmm-alerts/Cargo.toml +++ b/examples/raydium-clmm-alerts/Cargo.toml @@ -9,6 +9,7 @@ carbon-log-metrics = { workspace = true } carbon-raydium-clmm-decoder = { workspace = true } carbon-rpc-block-subscribe-datasource = { workspace = true } solana-client = { workspace = true } +solana-instruction = { workspace = true } async-trait = { workspace = true } dotenv = { workspace = true } diff --git a/examples/raydium-clmm-alerts/src/main.rs b/examples/raydium-clmm-alerts/src/main.rs index 1f2ba1a04..2da7fdb14 100644 --- a/examples/raydium-clmm-alerts/src/main.rs +++ b/examples/raydium-clmm-alerts/src/main.rs @@ -57,11 +57,12 @@ impl Processor for RaydiumClmmInstructionProcessor { InstructionMetadata, DecodedInstruction, NestedInstructions, + solana_instruction::Instruction, ); async fn process( &mut self, - (metadata, instruction, _nested_instructions): Self::InputType, + (metadata, instruction, _nested_instructions, _): Self::InputType, _metrics: Arc, ) -> CarbonResult<()> { let signature = metadata.transaction_metadata.signature; diff --git a/examples/raydium-cpmm-alerts/Cargo.toml b/examples/raydium-cpmm-alerts/Cargo.toml index 43ee32ad3..88a9de533 100644 --- a/examples/raydium-cpmm-alerts/Cargo.toml +++ b/examples/raydium-cpmm-alerts/Cargo.toml @@ -14,4 +14,5 @@ async-trait = { workspace = true } dotenv = { workspace = true } env_logger = { workspace = true } log = { workspace = true } +solana-instruction = { workspace = true } tokio = { workspace = true, features = ["full"] } diff --git a/examples/raydium-cpmm-alerts/src/main.rs b/examples/raydium-cpmm-alerts/src/main.rs index 3d4435614..866e4ca66 100644 --- a/examples/raydium-cpmm-alerts/src/main.rs +++ b/examples/raydium-cpmm-alerts/src/main.rs @@ -56,11 +56,12 @@ impl Processor for RaydiumCpmmInstructionProcessor { InstructionMetadata, DecodedInstruction, NestedInstructions, + solana_instruction::Instruction, ); async fn process( &mut self, - (metadata, instruction, _nested_instructions): Self::InputType, + (metadata, instruction, _nested_instructions, _): Self::InputType, _metrics: Arc, ) -> CarbonResult<()> { let signature = metadata.transaction_metadata.signature; diff --git a/examples/sharky-offers/src/main.rs b/examples/sharky-offers/src/main.rs index 16b64d9d0..b3ef95178 100644 --- a/examples/sharky-offers/src/main.rs +++ b/examples/sharky-offers/src/main.rs @@ -108,7 +108,7 @@ impl Processor for SharkyAccountProcessor { update: Self::InputType, _metrics: Arc, ) -> CarbonResult<()> { - let (_metadata, account) = update; + let (_metadata, account, _raw_account) = update; match account.data { SharkyAccount::OrderBook(order_book) => { diff --git a/examples/token-indexing/Cargo.toml b/examples/token-indexing/Cargo.toml index ca2dfbcb0..6e063dd2a 100644 --- a/examples/token-indexing/Cargo.toml +++ b/examples/token-indexing/Cargo.toml @@ -16,6 +16,7 @@ spl-token = { workspace = true } async-trait = { workspace = true } dotenv = { workspace = true } log = { workspace = true } +solana-account = { workspace = true } tokio = { workspace = true, features = ["full"] } yellowstone-grpc-proto = { workspace = true } diff --git a/examples/token-indexing/src/main.rs b/examples/token-indexing/src/main.rs index 1c9def88b..cf5895c04 100644 --- a/examples/token-indexing/src/main.rs +++ b/examples/token-indexing/src/main.rs @@ -131,7 +131,11 @@ pub struct TokenProgramAccountProcessor { #[async_trait] impl Processor for TokenProgramAccountProcessor { - type InputType = (AccountMetadata, DecodedAccount); + type InputType = ( + AccountMetadata, + DecodedAccount, + solana_account::Account, + ); async fn process( &mut self,