From f95e0b57317648f59dc0807391eaf8f1f610f449 Mon Sep 17 00:00:00 2001 From: Florent Tapponnier Date: Tue, 30 Jun 2026 12:46:21 +0200 Subject: [PATCH] fix(polymarket-resolution-delay): convert query output to ms for fmtUnit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The harness publishes a histogram in seconds (pmres_resolution_delay_seconds_bucket per Prom convention). fmtUnit for unit=s expects the value in milliseconds (the project convention used by l1-finality and aggregator-head-lag, where the histogram is *_milliseconds_bucket). Result: the bench's actual p50 of 679s (11.3 min) for crypto was rendered as 0.7s on the share card / OG image / leaderboard. Wrap every histogram_quantile with 1000 * so the value arrives in ms and the auto-flip to min/h kicks in correctly. No code change in fmtUnit — keeps the convention consistent across all s-unit benches. --- benchmarks/polymarket-resolution-delay.yml | 40 +++++++++++----------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/benchmarks/polymarket-resolution-delay.yml b/benchmarks/polymarket-resolution-delay.yml index 07ac6bad4..ccdf1a427 100644 --- a/benchmarks/polymarket-resolution-delay.yml +++ b/benchmarks/polymarket-resolution-delay.yml @@ -129,62 +129,62 @@ providers: tag: Every resolved market across categories formula: "Median seconds from first OO ProposePrice block to QuestionResolved block, cumulative histogram over the listener's window. The success column is the share resolved within 2 hours of proposal, the number the 93 percent claim pretends to be." queries: - p50: histogram_quantile(0.50, sum by (le) (pmres_resolution_delay_seconds_bucket)) - p90: histogram_quantile(0.90, sum by (le) (pmres_resolution_delay_seconds_bucket)) - p99: histogram_quantile(0.99, sum by (le) (pmres_resolution_delay_seconds_bucket)) + p50: 1000 * histogram_quantile(0.50, sum by (le) (pmres_resolution_delay_seconds_bucket)) + p90: 1000 * histogram_quantile(0.90, sum by (le) (pmres_resolution_delay_seconds_bucket)) + p99: 1000 * histogram_quantile(0.99, sum by (le) (pmres_resolution_delay_seconds_bucket)) mean: sum(pmres_resolution_delay_seconds_sum) / sum(pmres_resolution_delay_seconds_count) success: clamp_max(sum(pmres_resolution_delay_seconds_bucket{le="7200"}) / sum(pmres_resolution_delay_seconds_count), 1) sample_size: sum(pmres_resolutions_total) - series: histogram_quantile(0.50, sum by (le) (pmres_resolution_delay_seconds_bucket)) + series: 1000 * histogram_quantile(0.50, sum by (le) (pmres_resolution_delay_seconds_bucket)) - slug: sports name: Sports tag: Game and match markets, the volume majority formula: "Median seconds from first proposal to resolution for sports markets. Success column is the share within 2 hours of proposal." queries: - p50: histogram_quantile(0.50, sum by (le) (pmres_resolution_delay_seconds_bucket{category="sports"})) - p90: histogram_quantile(0.90, sum by (le) (pmres_resolution_delay_seconds_bucket{category="sports"})) - p99: histogram_quantile(0.99, sum by (le) (pmres_resolution_delay_seconds_bucket{category="sports"})) + p50: 1000 * histogram_quantile(0.50, sum by (le) (pmres_resolution_delay_seconds_bucket{category="sports"})) + p90: 1000 * histogram_quantile(0.90, sum by (le) (pmres_resolution_delay_seconds_bucket{category="sports"})) + p99: 1000 * histogram_quantile(0.99, sum by (le) (pmres_resolution_delay_seconds_bucket{category="sports"})) mean: sum(pmres_resolution_delay_seconds_sum{category="sports"}) / sum(pmres_resolution_delay_seconds_count{category="sports"}) success: clamp_max(sum(pmres_resolution_delay_seconds_bucket{le="7200",category="sports"}) / sum(pmres_resolution_delay_seconds_count{category="sports"}), 1) sample_size: sum(pmres_resolutions_total{category="sports"}) - series: histogram_quantile(0.50, sum by (le) (pmres_resolution_delay_seconds_bucket{category="sports"})) + series: 1000 * histogram_quantile(0.50, sum by (le) (pmres_resolution_delay_seconds_bucket{category="sports"})) - slug: crypto name: Crypto tag: Price markets, machine checkable outcomes formula: "Median seconds from first proposal to resolution for crypto price markets. Success column is the share within 2 hours of proposal." queries: - p50: histogram_quantile(0.50, sum by (le) (pmres_resolution_delay_seconds_bucket{category="crypto"})) - p90: histogram_quantile(0.90, sum by (le) (pmres_resolution_delay_seconds_bucket{category="crypto"})) - p99: histogram_quantile(0.99, sum by (le) (pmres_resolution_delay_seconds_bucket{category="crypto"})) + p50: 1000 * histogram_quantile(0.50, sum by (le) (pmres_resolution_delay_seconds_bucket{category="crypto"})) + p90: 1000 * histogram_quantile(0.90, sum by (le) (pmres_resolution_delay_seconds_bucket{category="crypto"})) + p99: 1000 * histogram_quantile(0.99, sum by (le) (pmres_resolution_delay_seconds_bucket{category="crypto"})) mean: sum(pmres_resolution_delay_seconds_sum{category="crypto"}) / sum(pmres_resolution_delay_seconds_count{category="crypto"}) success: clamp_max(sum(pmres_resolution_delay_seconds_bucket{le="7200",category="crypto"}) / sum(pmres_resolution_delay_seconds_count{category="crypto"}), 1) sample_size: sum(pmres_resolutions_total{category="crypto"}) - series: histogram_quantile(0.50, sum by (le) (pmres_resolution_delay_seconds_bucket{category="crypto"})) + series: 1000 * histogram_quantile(0.50, sum by (le) (pmres_resolution_delay_seconds_bucket{category="crypto"})) - slug: politics name: Politics tag: Election and policy markets, conservative windows formula: "Median seconds from first proposal to resolution for politics markets. Success column is the share within 2 hours of proposal." queries: - p50: histogram_quantile(0.50, sum by (le) (pmres_resolution_delay_seconds_bucket{category="politics"})) - p90: histogram_quantile(0.90, sum by (le) (pmres_resolution_delay_seconds_bucket{category="politics"})) - p99: histogram_quantile(0.99, sum by (le) (pmres_resolution_delay_seconds_bucket{category="politics"})) + p50: 1000 * histogram_quantile(0.50, sum by (le) (pmres_resolution_delay_seconds_bucket{category="politics"})) + p90: 1000 * histogram_quantile(0.90, sum by (le) (pmres_resolution_delay_seconds_bucket{category="politics"})) + p99: 1000 * histogram_quantile(0.99, sum by (le) (pmres_resolution_delay_seconds_bucket{category="politics"})) mean: sum(pmres_resolution_delay_seconds_sum{category="politics"}) / sum(pmres_resolution_delay_seconds_count{category="politics"}) success: clamp_max(sum(pmres_resolution_delay_seconds_bucket{le="7200",category="politics"}) / sum(pmres_resolution_delay_seconds_count{category="politics"}), 1) sample_size: sum(pmres_resolutions_total{category="politics"}) - series: histogram_quantile(0.50, sum by (le) (pmres_resolution_delay_seconds_bucket{category="politics"})) + series: 1000 * histogram_quantile(0.50, sum by (le) (pmres_resolution_delay_seconds_bucket{category="politics"})) - slug: other name: Other tag: Culture, weather, science and everything else formula: "Median seconds from first proposal to resolution for uncategorized markets. Success column is the share within 2 hours of proposal." queries: - p50: histogram_quantile(0.50, sum by (le) (pmres_resolution_delay_seconds_bucket{category="other"})) - p90: histogram_quantile(0.90, sum by (le) (pmres_resolution_delay_seconds_bucket{category="other"})) - p99: histogram_quantile(0.99, sum by (le) (pmres_resolution_delay_seconds_bucket{category="other"})) + p50: 1000 * histogram_quantile(0.50, sum by (le) (pmres_resolution_delay_seconds_bucket{category="other"})) + p90: 1000 * histogram_quantile(0.90, sum by (le) (pmres_resolution_delay_seconds_bucket{category="other"})) + p99: 1000 * histogram_quantile(0.99, sum by (le) (pmres_resolution_delay_seconds_bucket{category="other"})) mean: sum(pmres_resolution_delay_seconds_sum{category="other"}) / sum(pmres_resolution_delay_seconds_count{category="other"}) success: clamp_max(sum(pmres_resolution_delay_seconds_bucket{le="7200",category="other"}) / sum(pmres_resolution_delay_seconds_count{category="other"}), 1) sample_size: sum(pmres_resolutions_total{category="other"}) - series: histogram_quantile(0.50, sum by (le) (pmres_resolution_delay_seconds_bucket{category="other"})) + series: 1000 * histogram_quantile(0.50, sum by (le) (pmres_resolution_delay_seconds_bucket{category="other"}))