feat(event_parser): add requires_inner_instruction field to skip incomplete events

- Add requires_inner_instruction field to GenericEventParseConfig
  - Skip events that require but lack inner instruction data during processing
  - Set PumpFun migrate events to require inner instructions (prevents parsing failed migrations)
This commit is contained in:
ioxde
2025-09-08 20:19:13 -07:00
parent d219433466
commit 8ec1457858
7 changed files with 50 additions and 0 deletions
@@ -39,6 +39,7 @@ impl RaydiumCpmmEventParser {
event_type: EventType::RaydiumCpmmSwapBaseInput,
inner_instruction_parser: None,
instruction_parser: Some(Self::parse_swap_base_input_instruction),
requires_inner_instruction: false,
},
GenericEventParseConfig {
program_id: RAYDIUM_CPMM_PROGRAM_ID,
@@ -48,6 +49,7 @@ impl RaydiumCpmmEventParser {
event_type: EventType::RaydiumCpmmSwapBaseOutput,
inner_instruction_parser: None,
instruction_parser: Some(Self::parse_swap_base_output_instruction),
requires_inner_instruction: false,
},
GenericEventParseConfig {
program_id: RAYDIUM_CPMM_PROGRAM_ID,
@@ -57,6 +59,7 @@ impl RaydiumCpmmEventParser {
event_type: EventType::RaydiumCpmmDeposit,
inner_instruction_parser: None,
instruction_parser: Some(Self::parse_deposit_instruction),
requires_inner_instruction: false,
},
GenericEventParseConfig {
program_id: RAYDIUM_CPMM_PROGRAM_ID,
@@ -66,6 +69,7 @@ impl RaydiumCpmmEventParser {
event_type: EventType::RaydiumCpmmInitialize,
inner_instruction_parser: None,
instruction_parser: Some(Self::parse_initialize_instruction),
requires_inner_instruction: false,
},
GenericEventParseConfig {
program_id: RAYDIUM_CPMM_PROGRAM_ID,
@@ -75,6 +79,7 @@ impl RaydiumCpmmEventParser {
event_type: EventType::RaydiumCpmmWithdraw,
inner_instruction_parser: None,
instruction_parser: Some(Self::parse_withdraw_instruction),
requires_inner_instruction: false,
},
];