This commit is contained in:
2026-05-30 01:14:30 +02:00
parent ffa4acbccb
commit 7bd6593015
20 changed files with 4359 additions and 456 deletions

View File

@@ -26,6 +26,10 @@ pub use fluxbeam::FluxbeamSwapDecoded;
pub use meteora_damm_v1::MeteoraDammV1CreatePoolDecoded;
pub use meteora_damm_v1::MeteoraDammV1DecodedEvent;
pub use meteora_damm_v1::MeteoraDammV1Decoder;
pub use meteora_damm_v1::MeteoraDammV1FeeDecoded;
pub use meteora_damm_v1::MeteoraDammV1LiquidityDecoded;
pub use meteora_damm_v1::MeteoraDammV1PoolAdminDecoded;
pub use meteora_damm_v1::MeteoraDammV1PoolLifecycleDecoded;
pub use meteora_damm_v1::MeteoraDammV1SwapDecoded;
pub use meteora_damm_v2::MeteoraDammV2CreatePoolDecoded;
pub use meteora_damm_v2::MeteoraDammV2DecodedEvent;

File diff suppressed because it is too large Load Diff

View File

@@ -468,7 +468,7 @@ impl MeteoraDlmmDecoder {
"accounts": accounts,
"parsed": parsed_json,
"logMessages": log_messages,
"proofStatus": "observed_local_corpus_and_known_carbon_layout",
"proofStatus": "upstream_git_local_corpus_observed",
"position": position_account,
"actorWallet": actor_wallet,
"rentReceiver": rent_receiver,
@@ -992,7 +992,7 @@ fn decode_anchor_lb_pair_create_event(
"anchorEventName": "lb_pair_create_event",
"anchorEventDiscriminatorHex": "b94afc7d1bd7bc6f",
"anchorEventPayloadSize": data.len().saturating_sub(8),
"proofStatus": "known_carbon_layout_pending_local_corpus_validation",
"proofStatus": "upstream_git_layout_unverified",
"lbPair": lb_pair,
"poolAccount": lb_pair,
"binStep": bin_step,
@@ -1052,7 +1052,7 @@ fn decode_anchor_liquidity_event(
"anchorEventName": anchor_event_name,
"anchorEventDiscriminatorHex": event_discriminator_hex,
"anchorEventPayloadSize": data.len().saturating_sub(8),
"proofStatus": "known_carbon_layout_pending_local_corpus_validation",
"proofStatus": "upstream_git_layout_unverified",
"lbPair": lb_pair,
"poolAccount": lb_pair,
"from": from,
@@ -1112,7 +1112,7 @@ fn decode_anchor_claim_fee_event(
"anchorEventName": "claim_fee_event",
"anchorEventDiscriminatorHex": "4b7a9a308c4a7ba3",
"anchorEventPayloadSize": data.len().saturating_sub(8),
"proofStatus": "known_carbon_layout_pending_local_corpus_validation",
"proofStatus": "upstream_git_layout_unverified",
"lbPair": lb_pair,
"poolAccount": lb_pair,
"position": position,
@@ -1167,7 +1167,7 @@ fn decode_anchor_claim_reward_event(
"anchorEventName": "claim_reward_event",
"anchorEventDiscriminatorHex": "947486cc16ab555f",
"anchorEventPayloadSize": data.len().saturating_sub(8),
"proofStatus": "known_carbon_layout_pending_local_corpus_validation",
"proofStatus": "upstream_git_layout_unverified",
"lbPair": lb_pair,
"poolAccount": lb_pair,
"position": position,
@@ -1222,7 +1222,7 @@ fn decode_anchor_fund_reward_event(
"anchorEventName": "fund_reward_event",
"anchorEventDiscriminatorHex": "f6e43a8291aa4fcc",
"anchorEventPayloadSize": data.len().saturating_sub(8),
"proofStatus": "known_carbon_layout_pending_local_corpus_validation",
"proofStatus": "upstream_git_layout_unverified",
"lbPair": lb_pair,
"poolAccount": lb_pair,
"funder": funder,
@@ -1275,7 +1275,7 @@ fn decode_anchor_position_create_event(
"anchorEventName": "position_create_event",
"anchorEventDiscriminatorHex": "908efc549d352579",
"anchorEventPayloadSize": data.len().saturating_sub(8),
"proofStatus": "known_carbon_layout_pending_local_corpus_validation",
"proofStatus": "upstream_git_layout_unverified",
"lbPair": lb_pair,
"poolAccount": lb_pair,
"position": position,
@@ -1328,7 +1328,7 @@ fn decode_anchor_position_close_event(
"anchorEventName": "position_close_event",
"anchorEventDiscriminatorHex": "ffc4106b1cca3580",
"anchorEventPayloadSize": data.len().saturating_sub(8),
"proofStatus": "known_carbon_layout_pending_local_corpus_validation",
"proofStatus": "upstream_git_layout_unverified",
"position": position,
"owner": owner,
"actorWallet": owner
@@ -2248,7 +2248,7 @@ fn resolve_dlmm_instruction_proof_status(
MeteoraDlmmInstructionName::AddLiquidityByStrategy2
| MeteoraDlmmInstructionName::AddLiquidityByWeight
| MeteoraDlmmInstructionName::RemoveLiquidityByRange2 => {
return "observed_local_corpus_and_known_carbon_layout";
return "upstream_git_local_corpus_observed";
},
_ => return "decoded_from_instruction_discriminator_or_local_hint",
}
@@ -2858,7 +2858,7 @@ mod tests {
}
#[test]
fn meteora_dlmm_swap_accounts_are_mapped_from_carbon_layout() {
fn meteora_dlmm_swap_accounts_are_mapped_from_upstream_git_layout() {
let accounts = vec![
"LbPair111".to_string(),
"Bitmap111".to_string(),

View File

@@ -564,7 +564,7 @@ impl DexDecodeService {
None,
event.token_a_mint.clone(),
event.token_b_mint.clone(),
event.config_account.clone(),
event.lp_mint.clone(),
event.payload_json.clone(),
)
.await;
@@ -589,6 +589,78 @@ impl DexDecodeService {
)
.await;
},
crate::MeteoraDammV1DecodedEvent::Liquidity(event) => {
return self
.materialize_named_dex_event(
transaction,
event.transaction_id,
event.instruction_id,
"meteora_damm_v1",
event.program_id.clone(),
event.event_kind.as_str(),
event.pool_account.clone(),
None,
event.token_a_mint.clone(),
event.token_b_mint.clone(),
event.lp_mint.clone(),
event.payload_json.clone(),
)
.await;
},
crate::MeteoraDammV1DecodedEvent::Fee(event) => {
return self
.materialize_named_dex_event(
transaction,
event.transaction_id,
event.instruction_id,
"meteora_damm_v1",
event.program_id.clone(),
event.event_kind.as_str(),
event.pool_account.clone(),
None,
None,
None,
event.lp_mint.clone(),
event.payload_json.clone(),
)
.await;
},
crate::MeteoraDammV1DecodedEvent::PoolLifecycle(event) => {
return self
.materialize_named_dex_event(
transaction,
event.transaction_id,
event.instruction_id,
"meteora_damm_v1",
event.program_id.clone(),
event.event_kind.as_str(),
event.pool_account.clone(),
None,
event.token_a_mint.clone(),
event.token_b_mint.clone(),
event.lp_mint.clone(),
event.payload_json.clone(),
)
.await;
},
crate::MeteoraDammV1DecodedEvent::PoolAdmin(event) => {
return self
.materialize_named_dex_event(
transaction,
event.transaction_id,
event.instruction_id,
"meteora_damm_v1",
event.program_id.clone(),
event.event_kind.as_str(),
event.pool_account.clone(),
None,
None,
None,
None,
event.payload_json.clone(),
)
.await;
},
}
}
@@ -1927,6 +1999,9 @@ fn instruction_audit_event_kind_by_protocol(
"raydium_clmm" => return Some("raydium_clmm.instruction_audit"),
"raydium_cpmm" => return Some("raydium_cpmm.instruction_audit"),
"meteora_dlmm" => return Some("meteora_dlmm.instruction_audit"),
"meteora_damm_v1" => return Some("meteora_damm_v1.instruction_audit"),
"meteora_damm_v2" => return Some("meteora_damm_v2.instruction_audit"),
"meteora_dbc" => return Some("meteora_dbc.instruction_audit"),
_ => return None,
}
}
@@ -3134,6 +3209,18 @@ mod tests {
super::instruction_audit_event_kind_by_protocol("meteora_dlmm"),
Some("meteora_dlmm.instruction_audit")
);
assert_eq!(
super::instruction_audit_event_kind_by_protocol("meteora_damm_v1"),
Some("meteora_damm_v1.instruction_audit")
);
assert_eq!(
super::instruction_audit_event_kind_by_protocol("meteora_damm_v2"),
Some("meteora_damm_v2.instruction_audit")
);
assert_eq!(
super::instruction_audit_event_kind_by_protocol("meteora_dbc"),
Some("meteora_dbc.instruction_audit")
);
assert_eq!(super::instruction_audit_event_kind_by_protocol("unknown"), None);
}
}

View File

@@ -173,6 +173,9 @@ pub fn classify_dex_event_lifecycle_kind(event_kind: &str) -> DexEventLifecycleK
if is_dex_informational_event_kind(event_kind) {
return DexEventLifecycleKind::InstructionAudit;
}
if event_kind.contains(".create_lock_escrow") {
return DexEventLifecycleKind::PoolCreation;
}
if is_dex_token_burn_event_kind(event_kind) {
return DexEventLifecycleKind::Burn;
}
@@ -408,6 +411,12 @@ pub fn is_dex_fee_event_kind(event_kind: &str) -> bool {
if event_kind.contains("claim_fee") {
return true;
}
if event_kind.contains("withdraw_protocol_fees") {
return true;
}
if event_kind.contains("partner_claim_fee") {
return true;
}
return false;
}
@@ -424,6 +433,9 @@ pub fn is_dex_reward_event_kind(event_kind: &str) -> bool {
/// Returns true for pool, pair, launch, mint, burn or migration lifecycle events.
pub fn is_dex_pool_lifecycle_event_kind(event_kind: &str) -> bool {
if event_kind.contains(".create_lock_escrow") {
return true;
}
if event_kind.contains(".initialize_bin_array") {
return true;
}
@@ -534,6 +546,9 @@ pub fn is_dex_pair_creation_event_kind(event_kind: &str) -> bool {
/// Returns true for admin, configuration or permission changes.
pub fn is_dex_admin_event_kind(event_kind: &str) -> bool {
if event_kind.contains(".lock_liquidity") {
return true;
}
if event_kind.contains("admin") {
return true;
}
@@ -1102,4 +1117,32 @@ mod tests {
"non_trade_useful"
);
}
#[test]
fn classifies_damm_v1_lock_events_as_non_trade_useful() {
assert_eq!(
super::classify_dex_event_category_code("meteora_damm_v1.create_lock_escrow"),
"pool_lifecycle"
);
assert_eq!(
super::classify_dex_event_lifecycle_kind_code("meteora_damm_v1.create_lock_escrow"),
"pool_creation"
);
assert_eq!(
super::classify_dex_event_category_code("meteora_damm_v1.lock_liquidity"),
"admin"
);
assert_eq!(
super::classify_dex_event_lifecycle_kind_code("meteora_damm_v1.lock_liquidity"),
"admin_config"
);
assert_eq!(
super::classify_dex_event_actionability_code(
"meteora_damm_v1.lock_liquidity",
false,
false,
),
"non_trade_useful"
);
}
}

View File

@@ -901,6 +901,14 @@ pub use dex::MeteoraDammV1CreatePoolDecoded;
pub use dex::MeteoraDammV1DecodedEvent;
/// Meteora DAMM v1 decoder.
pub use dex::MeteoraDammV1Decoder;
/// Decoded Meteora DAMM v1 fee event.
pub use dex::MeteoraDammV1FeeDecoded;
/// Decoded Meteora DAMM v1 liquidity event.
pub use dex::MeteoraDammV1LiquidityDecoded;
/// Decoded Meteora DAMM v1 pool administration event.
pub use dex::MeteoraDammV1PoolAdminDecoded;
/// Decoded Meteora DAMM v1 pool lifecycle event.
pub use dex::MeteoraDammV1PoolLifecycleDecoded;
/// Decoded Meteora DAMM v1 swap event.
pub use dex::MeteoraDammV1SwapDecoded;
/// Decoded Meteora DAMM v2 create-pool event.
@@ -1158,6 +1166,8 @@ pub use non_trade_event_materialization::NonTradeEventMaterializationResult;
pub use non_trade_event_materialization::NonTradeEventMaterializationService;
/// Candidate account inferred from generic transaction evidence.
pub use onchain_dex_pair_discovery::OnchainDexCandidateAccountDto;
/// Cursor hint for one on-chain DEX discovery source address.
pub use onchain_dex_pair_discovery::OnchainDexPaginationCursorDto;
/// Candidate transaction/instruction observed on-chain for one DEX program id.
pub use onchain_dex_pair_discovery::OnchainDexPairCandidateDto;
/// Request for on-chain DEX pair/pool discovery.

View File

@@ -7,8 +7,7 @@
//! deterministic local pipeline over their signatures.
const LOCAL_PIPELINE_DEX_DECODER_SCOPE: &str = "dex_decode.local_pipeline";
const LOCAL_PIPELINE_DEX_DECODER_VERSION: &str =
"dex_decode.v0.7.45.dlmm_add_liquidity_strategies1";
const LOCAL_PIPELINE_DEX_DECODER_VERSION: &str = "dex_decode.v0.7.46.damm_v1_events1";
fn default_skip_certified_dex_decode() -> bool {
return true;

File diff suppressed because it is too large Load Diff