0.7.34
This commit is contained in:
@@ -290,12 +290,21 @@ pub fn is_dex_liquidity_event_kind(event_kind: &str) -> bool {
|
||||
if event_kind.contains(".withdraw") {
|
||||
return true;
|
||||
}
|
||||
if event_kind.contains(".add_liquidity") {
|
||||
return true;
|
||||
}
|
||||
if event_kind.contains(".remove_liquidity") {
|
||||
return true;
|
||||
}
|
||||
if event_kind.contains(".increase_liquidity") {
|
||||
return true;
|
||||
}
|
||||
if event_kind.contains(".decrease_liquidity") {
|
||||
return true;
|
||||
}
|
||||
if event_kind.contains(".initialize_position") {
|
||||
return true;
|
||||
}
|
||||
if event_kind.contains(".open_position") {
|
||||
return true;
|
||||
}
|
||||
@@ -335,6 +344,9 @@ pub fn is_dex_liquidity_remove_event_kind(event_kind: &str) -> bool {
|
||||
|
||||
/// Returns true for concentrated-liquidity position open events.
|
||||
pub fn is_dex_position_open_event_kind(event_kind: &str) -> bool {
|
||||
if event_kind.contains(".initialize_position") {
|
||||
return true;
|
||||
}
|
||||
if event_kind.contains(".open_position") {
|
||||
return true;
|
||||
}
|
||||
@@ -379,6 +391,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(".initialize_bin_array") {
|
||||
return true;
|
||||
}
|
||||
if is_dex_pool_creation_event_kind(event_kind) {
|
||||
return true;
|
||||
}
|
||||
@@ -452,6 +467,12 @@ pub fn is_dex_migration_event_kind(event_kind: &str) -> bool {
|
||||
|
||||
/// Returns true for pool creation or initialization events.
|
||||
pub fn is_dex_pool_creation_event_kind(event_kind: &str) -> bool {
|
||||
if event_kind.contains(".initialize_position") {
|
||||
return false;
|
||||
}
|
||||
if event_kind.contains(".initialize_bin_array") {
|
||||
return true;
|
||||
}
|
||||
if event_kind.contains(".initialize") {
|
||||
return true;
|
||||
}
|
||||
@@ -995,4 +1016,44 @@ mod tests {
|
||||
});
|
||||
assert!(!super::decoded_payload_has_trade_amount_or_price_payload(&empty_payload_json));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn classifies_dlmm_add_remove_liquidity_and_positions_as_non_trade_useful() {
|
||||
assert_eq!(
|
||||
super::classify_dex_event_category_code("meteora_dlmm.add_liquidity"),
|
||||
"liquidity"
|
||||
);
|
||||
assert_eq!(
|
||||
super::classify_dex_event_category_code("meteora_dlmm.remove_liquidity"),
|
||||
"liquidity"
|
||||
);
|
||||
assert_eq!(
|
||||
super::classify_dex_event_lifecycle_kind_code("meteora_dlmm.initialize_position"),
|
||||
"position_open"
|
||||
);
|
||||
assert_eq!(
|
||||
super::classify_dex_event_actionability_code(
|
||||
"meteora_dlmm.add_liquidity",
|
||||
false,
|
||||
false,
|
||||
),
|
||||
"non_trade_useful"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn classifies_dlmm_bin_array_initialization_as_pool_lifecycle() {
|
||||
assert_eq!(
|
||||
super::classify_dex_event_category_code("meteora_dlmm.initialize_bin_array"),
|
||||
"pool_lifecycle"
|
||||
);
|
||||
assert_eq!(
|
||||
super::classify_dex_event_actionability_code(
|
||||
"meteora_dlmm.initialize_bin_array",
|
||||
false,
|
||||
false,
|
||||
),
|
||||
"non_trade_useful"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user