This commit is contained in:
2026-04-30 00:36:55 +02:00
parent 2f4d80d5ef
commit 523bbe0860
14 changed files with 1018 additions and 9 deletions

View File

@@ -106,6 +106,7 @@ pub struct KbTransactionResolutionService {
pool_origin_service: crate::KbPoolOriginService,
wallet_observation_service: crate::KbWalletObservationService,
trade_aggregation_service: crate::KbTradeAggregationService,
wallet_holding_observation_service: crate::KbWalletHoldingObservationService,
resolved_signatures:
std::sync::Arc<tokio::sync::Mutex<std::collections::HashSet<std::string::String>>>,
}
@@ -125,6 +126,8 @@ impl KbTransactionResolutionService {
let pool_origin_service = crate::KbPoolOriginService::new(database.clone());
let wallet_observation_service = crate::KbWalletObservationService::new(database.clone());
let trade_aggregation_service = crate::KbTradeAggregationService::new(database.clone());
let wallet_holding_observation_service =
crate::KbWalletHoldingObservationService::new(database.clone());
Self {
http_pool,
persistence,
@@ -136,6 +139,7 @@ impl KbTransactionResolutionService {
pool_origin_service,
wallet_observation_service,
trade_aggregation_service,
wallet_holding_observation_service,
resolved_signatures: std::sync::Arc::new(tokio::sync::Mutex::new(
std::collections::HashSet::new(),
)),
@@ -353,6 +357,15 @@ impl KbTransactionResolutionService {
Err(error) => return Err(error),
};
let wallet_participation_count = wallet_observations.len();
let wallet_holding_observations_result = self
.wallet_holding_observation_service
.record_transaction_by_signature(request.signature.as_str())
.await;
let wallet_holding_observations = match wallet_holding_observations_result {
Ok(wallet_holding_observations) => wallet_holding_observations,
Err(error) => return Err(error),
};
let wallet_holding_count = wallet_holding_observations.len();
let trade_aggregations_result = self
.trade_aggregation_service
.record_transaction_by_signature(request.signature.as_str())
@@ -374,6 +387,7 @@ impl KbTransactionResolutionService {
"launchAttributionCount": launch_attribution_count,
"poolOriginCount": pool_origin_count,
"walletParticipationCount": wallet_participation_count,
"walletHoldingCount": wallet_holding_count,
"tradeEventCount": trade_event_count,
"triggerPayload": request.trigger_payload.clone(),
"transaction": transaction_value