Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

fix: ensure bucket value does not exceed maximum in score calculation

zprv7f0ec5031ff0
diff --git a/api/oracle/backtest.js b/api/oracle/backtest.js
index a60eddc79..bf5215f80 100644
--- a/api/oracle/backtest.js
+++ b/api/oracle/backtest.js
@@ -114,7 +114,7 @@ async function query(days, tier, network) {
// This pass is unconditional on tier so the baseline is the true market rate.
const calRows = await sql`
select
- width_bucket(c.score, 0, 100, 10) as bucket,
+ least(width_bucket(c.score, 0, 100, 10), 10) as bucket,
count(*)::int as n,
count(*) filter (where o.graduated or o.ath_multiple >= 2)::int as wins,
round(avg(c.score)::numeric, 1) as avg_score