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.

pump(wrapped): finish the recap deck's slide set

nirholas77c487dc1046
diff --git a/api/_lib/wrapped.js b/api/_lib/wrapped.js
index 617414d9d..861ac64c2 100644
--- a/api/_lib/wrapped.js
+++ b/api/_lib/wrapped.js
@@ -55,6 +55,9 @@ const MIN_PEER_CLOSED = 3;
/** Closed trades this agent needs before a deck is worth cutting at all. */
const MIN_DECK_CLOSED = 3;
+/** Exported so the endpoint and the picker's empty state quote the same gate. */
+export const WRAPPED_MIN_CLOSED = MIN_DECK_CLOSED;
+
const num = (v) => {
const n = Number(v);
return Number.isFinite(n) ? n : 0;
@@ -303,11 +306,15 @@ function headlineFor(metrics, best, agent) {
const n = metrics.closed_count;
if (!n) return `${who} closed no round-trips in this window.`;
const sign = pnl >= 0 ? '+' : '';
+ // A season can settle a few thousand lamports up. Rounding that to "+0.00 SOL"
+ // reads as a typo, so small totals keep the digits that make them true.
+ const mag = Math.abs(pnl);
+ const dp = mag === 0 ? 2 : mag < 0.001 ? 6 : mag < 0.01 ? 4 : 2;
const bestPct = best?.realized_pnl_pct != null ? Number(best.realized_pnl_pct) : null;
const bestBit = bestPct != null && bestPct > 0
? ` Best trade: +${Math.round(bestPct)}% on ${best.symbol ? `$${best.symbol}` : 'one coin'}.`
: '';
- return `${who} closed ${n} round-trip${n === 1 ? '' : 's'} across ${metrics.unique_coins} coin${metrics.unique_coins === 1 ? '' : 's'} for ${sign}${pnl.toFixed(2)} SOL.${bestBit}`;
+ return `${who} closed ${n} round-trip${n === 1 ? '' : 's'} across ${metrics.unique_coins} coin${metrics.unique_coins === 1 ? '' : 's'} for ${sign}${pnl.toFixed(dp)} SOL.${bestBit}`;
}
// --- DB layer ---------------------------------------------------------------
diff --git a/api/pump/wrapped.js b/api/pump/wrapped.js
index 57916200e..69df71db1 100644
--- a/api/pump/wrapped.js
+++ b/api/pump/wrapped.js
@@ -18,7 +18,7 @@
import { cors, json, error, method, wrap, rateLimited } from '../_lib/http.js';
import { limits, clientIp } from '../_lib/rate-limit.js';
import { isUuid } from '../_lib/validate.js';
-import { WRAPPED_WINDOWS, WRAPPED_WINDOW_CHOICES, fetchWrappableTraders, getWrapped } from '../_lib/wrapped.js';
+import { WRAPPED_WINDOWS, WRAPPED_WINDOW_CHOICES, WRAPPED_MIN_CLOSED, fetchWrappableTraders, getWrapped } from '../_lib/wrapped.js';
const NETWORKS = new Set(['mainnet', 'devnet']);
@@ -57,6 +57,7 @@ export default wrap(async (req, res) => {
network,
window,
windows: WRAPPED_WINDOW_CHOICES,
+ min_closed: WRAPPED_MIN_CLOSED,
traders,
custody: 'none',
});