0.7.38
This commit is contained in:
@@ -451,6 +451,9 @@ pub(crate) struct DemoPipeline2LocalPipelineDiagnosticSummary {
|
||||
/// Missing trade events grouped by diagnostic reason.
|
||||
pub missing_trade_event_reason_summaries:
|
||||
std::vec::Vec<DemoPipeline2LocalMissingTradeEventReasonSummary>,
|
||||
/// Prioritized samples of tokens whose display metadata is still incomplete.
|
||||
pub token_metadata_gap_samples:
|
||||
std::vec::Vec<DemoPipeline2LocalTokenMetadataGapDiagnosticSample>,
|
||||
/// Total pairs with only non-actionable missing trade events.
|
||||
#[ts(type = "number")]
|
||||
pub non_actionable_pair_count: i64,
|
||||
@@ -893,6 +896,44 @@ pub(crate) struct DemoPipeline2LocalPairGapDiagnosticSample {
|
||||
pub pair_candle_count: i64,
|
||||
}
|
||||
|
||||
/// Local token metadata gap sample for the UI.
|
||||
#[derive(Clone, Debug, serde::Serialize, TS)]
|
||||
#[ts(
|
||||
export,
|
||||
export_to = "../frontend/ts/bindings/DemoPipeline2LocalTokenMetadataGapDiagnosticSample.ts"
|
||||
)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub(crate) struct DemoPipeline2LocalTokenMetadataGapDiagnosticSample {
|
||||
/// Token id.
|
||||
#[ts(type = "number")]
|
||||
pub token_id: i64,
|
||||
/// Mint address.
|
||||
pub mint: std::string::String,
|
||||
/// Current symbol, when present.
|
||||
pub symbol: std::option::Option<std::string::String>,
|
||||
/// Current name, when present.
|
||||
pub name: std::option::Option<std::string::String>,
|
||||
/// Current mint decimals, when known.
|
||||
#[ts(type = "number | null")]
|
||||
pub decimals: std::option::Option<i64>,
|
||||
/// Token program id.
|
||||
pub token_program: std::string::String,
|
||||
/// Whether this token row is flagged as quote token.
|
||||
pub is_quote_token: bool,
|
||||
/// Whether this token appears in at least one trade-materialized pair.
|
||||
pub used_by_trade_materialized_pair: bool,
|
||||
/// Whether this token appears on the quote side of at least one pair.
|
||||
pub used_as_quote_token: bool,
|
||||
/// Number of trade-materialized pairs using this token.
|
||||
#[ts(type = "number")]
|
||||
pub trade_materialized_pair_count: i64,
|
||||
/// Number of catalog pairs using this token.
|
||||
#[ts(type = "number")]
|
||||
pub total_pair_count: i64,
|
||||
/// Prioritization bucket.
|
||||
pub priority: std::string::String,
|
||||
}
|
||||
|
||||
/// One token item for the local catalog.
|
||||
#[derive(Clone, Debug, serde::Serialize, TS)]
|
||||
#[ts(export, export_to = "../frontend/ts/bindings/DemoPipeline2TokenItem.ts")]
|
||||
@@ -1147,7 +1188,7 @@ pub(crate) async fn demo_pipeline2_validate_local_pipeline(
|
||||
let service = kb_lib::LocalPipelineValidationService::new(database.clone());
|
||||
let profile_code = match request {
|
||||
Some(request) => request.profile_code,
|
||||
None => "0.7.37_token_metadata_catalog_enrichment".to_string(),
|
||||
None => "0.7.38_token_metadata_gap_prioritization".to_string(),
|
||||
};
|
||||
let run_result = match profile_code.as_str() {
|
||||
"0.7.27" | "0.7.27_dexes_non_regression" => {
|
||||
@@ -1183,6 +1224,9 @@ pub(crate) async fn demo_pipeline2_validate_local_pipeline(
|
||||
"0.7.37" | "0.7.37_token_metadata_catalog_enrichment" => {
|
||||
service.validate_v0_7_37_current_database().await
|
||||
},
|
||||
"0.7.38" | "0.7.38_token_metadata_gap_prioritization" => {
|
||||
service.validate_v0_7_38_current_database().await
|
||||
},
|
||||
other => Err(kb_lib::Error::InvalidState(format!(
|
||||
"unsupported local pipeline validation profile: {other}"
|
||||
))),
|
||||
@@ -1733,6 +1777,10 @@ fn demo_pipeline2_map_local_diagnostics_summary(
|
||||
multi_trade_signature_pair_samples
|
||||
.push(demo_pipeline2_map_multi_trade_signature_pair_sample(sample));
|
||||
}
|
||||
let mut token_metadata_gap_samples = std::vec::Vec::new();
|
||||
for sample in summary.token_metadata_gap_samples {
|
||||
token_metadata_gap_samples.push(demo_pipeline2_map_token_metadata_gap_sample(sample));
|
||||
}
|
||||
let mut pair_without_trade_samples = std::vec::Vec::new();
|
||||
for sample in summary.pair_without_trade_samples {
|
||||
pair_without_trade_samples.push(demo_pipeline2_map_pair_gap_sample(sample));
|
||||
@@ -1805,6 +1853,7 @@ fn demo_pipeline2_map_local_diagnostics_summary(
|
||||
decoded_event_summaries,
|
||||
event_classification_summaries,
|
||||
missing_trade_event_reason_summaries,
|
||||
token_metadata_gap_samples,
|
||||
non_actionable_pair_count: summary.non_actionable_pair_count,
|
||||
non_actionable_pair_summaries,
|
||||
missing_trade_event_samples,
|
||||
@@ -2003,6 +2052,25 @@ fn demo_pipeline2_map_multi_trade_signature_pair_sample(
|
||||
};
|
||||
}
|
||||
|
||||
fn demo_pipeline2_map_token_metadata_gap_sample(
|
||||
sample: kb_lib::LocalTokenMetadataGapDiagnosticSampleDto,
|
||||
) -> DemoPipeline2LocalTokenMetadataGapDiagnosticSample {
|
||||
return DemoPipeline2LocalTokenMetadataGapDiagnosticSample {
|
||||
token_id: sample.token_id,
|
||||
mint: sample.mint,
|
||||
symbol: sample.symbol,
|
||||
name: sample.name,
|
||||
decimals: sample.decimals,
|
||||
token_program: sample.token_program,
|
||||
is_quote_token: sample.is_quote_token,
|
||||
used_by_trade_materialized_pair: sample.used_by_trade_materialized_pair,
|
||||
used_as_quote_token: sample.used_as_quote_token,
|
||||
trade_materialized_pair_count: sample.trade_materialized_pair_count,
|
||||
total_pair_count: sample.total_pair_count,
|
||||
priority: sample.priority,
|
||||
};
|
||||
}
|
||||
|
||||
fn demo_pipeline2_map_pair_gap_sample(
|
||||
sample: kb_lib::LocalPairGapDiagnosticSampleDto,
|
||||
) -> DemoPipeline2LocalPairGapDiagnosticSample {
|
||||
|
||||
Reference in New Issue
Block a user