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.

Sniper: cumulative PnL chart in trade history

nirholasb207eb9c6763
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6a7806818..c414cc679 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -42,6 +42,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Radar drawer: Oracle conviction scores now inline with coin intelligence** — When you open a coin in the /radar drawer, it now shows the Oracle conviction score alongside the coin intelligence analysis — score, tier badge, and four pillar bars (pedigree/structure/narrative/momentum), with a link to the full Oracle breakdown. Data loads asynchronously so the drawer opens instantly. (`/radar`) `[improvement]`
- **Rich OG cards on every shared coin link — price, score, and live status in the preview** — Every /launches/<mint> page now generates a dynamic social card — visible in X, Telegram, Discord, Slack, and iMessage link previews. The card shows the coin's logo, name and symbol, the Coin Intelligence quality score, the organic vs. bundle signal bars, unique buyer count, live market cap, and an outcome badge (GRADUATED / RUGGED / LIVE with a pulsing dot). Every shared link becomes a signal at a glance — no click required. (`/launches`) `[improvement]`
- **Sniper Strategies dashboard — manage autonomous trading agents** — A new dashboard page at /dashboard/sniper lets you arm, configure, and monitor your autonomous pump.fun sniper agents without touching code. Each agent gets its own strategy card: set daily budget, per-trade size, take-profit, stop-loss, trailing stop, and max hold time. Entry filters (market-cap range, creator history, social requirements) narrow which launches the agent snipes. Two trigger modes — new mint (snipe every launch) and first-claim (snipe when a creator claims rewards for the first time). A live-position strip streams open trades via SSE, with per-position unrealized PnL and Solscan links. Kill-switch is one click. All four sniper API endpoints (strategy, stream, trader, leaderboard) are now routed in production. (`/dashboard/sniper`) `[feature]`
+- **Sniper: Cumulative PnL chart in trade history** — The Sniper Strategies page now shows a cumulative PnL curve above the trade history table. Each completed trade is plotted in chronological order, so you can see at a glance how your strategy's performance has trended over time. The chart is color-coded green or red based on the net result and includes smooth bezier interpolation between trades. (`/dashboard/sniper`) `[improvement]`
- **Sniper: Oracle conviction gate** — Agent sniper strategies now support a Min Oracle conviction setting (0–100). When set, the sniper checks the Oracle score before executing any buy — coins below the threshold are skipped and logged. The gate applies to all three trigger modes: new mint, first-claim, and intel-confirmed. Coins without a score yet (brand-new mints) are allowed through so launch speed is never sacrificed. Configure it in the sniper strategy form on the dashboard. (`/dashboard/sniper`) `[feature]`
- **Sniper: personal Telegram trade notifications** — Each sniper strategy can now send buy and sell alerts to your own Telegram chat instead of (or in addition to) the platform ops channel. Add your Telegram chat ID in the Notifications section of any strategy form on the sniper dashboard. Get instant alerts the moment your agent opens or closes a position, with coin name, size, PnL, and Solscan proof link. (`/dashboard/sniper`) `[feature]`
- **Strategy Lab: backtest Oracle strategies before you deploy** — New standalone page at /strategy-lab lets you pick a conviction tier and time window, then see exactly how that filter would have performed: win rate, graduates, 3×/5× hit count, per-tier breakdown, and the top performers in the window. Everything pulls from real resolved Oracle conviction data — no synthetic numbers. Run a backtest, then deploy directly to the sniper from the results page. (`/strategy-lab`) `[feature]`
diff --git a/data/changelog.json b/data/changelog.json
index f15a653c0..cb08f21b9 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,13 @@
{
"$comment": "Curated changelog entries for three.ws — the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.",
"entries": [
+ {
+ "date": "2026-06-16",
+ "title": "Sniper: Cumulative PnL chart in trade history",
+ "summary": "The Sniper Strategies page now shows a cumulative PnL curve above the trade history table. Each completed trade is plotted in chronological order, so you can see at a glance how your strategy's performance has trended over time. The chart is color-coded green or red based on the net result and includes smooth bezier interpolation between trades.",
+ "tags": ["improvement"],
+ "link": "/dashboard/sniper"
+ },
{
"date": "2026-06-16",
"title": "Oracle: Conviction-weighted position sizing",
diff --git a/public/changelog.json b/public/changelog.json
index 7a91412e2..dd9ea189a 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-16T07:02:32.992Z",
+ "generated_at": "2026-06-16T07:04:29.220Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -372,6 +372,16 @@
"feature"
]
},
+ {
+ "date": "2026-06-16",
+ "type": "update",
+ "title": "Sniper: Cumulative PnL chart in trade history",
+ "summary": "The Sniper Strategies page now shows a cumulative PnL curve above the trade history table. Each completed trade is plotted in chronological order, so you can see at a glance how your strategy's performance has trended over time. The chart is color-coded green or red based on the net result and includes smooth bezier interpolation between trades.",
+ "link": "/dashboard/sniper",
+ "tags": [
+ "improvement"
+ ]
+ },
{
"date": "2026-06-16",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index 83eb97dc5..e6a31a1f9 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -294,6 +294,14 @@
<category>feature</category>
<description>A new dashboard page at /dashboard/sniper lets you arm, configure, and monitor your autonomous pump.fun sniper agents without touching code. Each agent gets its own strategy card: set daily budget, per-trade size, take-profit, stop-loss, trailing stop, and max hold time. Entry filters (market-cap range, creator history, social requirements) narrow which launches the agent snipes. Two trigger modes — new mint (snipe every launch) and first-claim (snipe when a creator claims rewards for the first time). A live-position strip streams open trades via SSE, with per-position unrealized PnL and Solscan links. Kill-switch is one click. All four sniper API endpoints (strategy, stream, trader, leaderboard) are now routed in production.</description>
</item>
+ <item>
+ <title>Sniper: Cumulative PnL chart in trade history</title>
+ <link>https://three.ws/dashboard/sniper</link>
+ <guid isPermaLink="false">2026-06-16:Sniper: Cumulative PnL chart in trade history</guid>
+ <pubDate>Tue, 16 Jun 2026 12:00:00 GMT</pubDate>
+ <category>improvement</category>
+ <description>The Sniper Strategies page now shows a cumulative PnL curve above the trade history table. Each completed trade is plotted in chronological order, so you can see at a glance how your strategy's performance has trended over time. The chart is color-coded green or red based on the net result and includes smooth bezier interpolation between trades.</description>
+ </item>
<item>
<title>Sniper: Oracle conviction gate</title>
<link>https://three.ws/dashboard/sniper</link>
diff --git a/public/features.json b/public/features.json
index 10bebd501..ecea9dddb 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-16T06:34:54.288Z",
+ "generated_at": "2026-06-16T07:04:29.204Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/src/dashboard-next/pages/sniper.js b/src/dashboard-next/pages/sniper.js
index b89988f74..fa60cf062 100644
--- a/src/dashboard-next/pages/sniper.js
+++ b/src/dashboard-next/pages/sniper.js
@@ -153,6 +153,13 @@ const STYLE = `<style>
.sn-hist-more:hover { color: var(--nxt-ink); }
@media (max-width: 640px) { .sn-hist-table th.hide-mobile, .sn-hist-row td.hide-mobile { display: none; } }
+/* pnl chart */
+.sn-chart-wrap { padding: 14px 18px 10px; border-bottom: 1px solid var(--nxt-line); }
+.sn-chart-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
+.sn-chart-label { font-size: 11px; color: var(--nxt-ink-faint); text-transform: uppercase; letter-spacing: .07em; font-family: var(--nxt-mono, monospace); }
+.sn-chart-val { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; font-family: var(--nxt-mono, monospace); }
+.sn-chart-canvas { width: 100%; height: 90px; display: block; }
+
/* new strategy cta */
.sn-new { background: var(--nxt-panel); border: 1px dashed var(--nxt-stroke); border-radius: var(--nxt-radius); padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sn-new-text { font-size: 13px; color: var(--nxt-ink-faint); max-width: 340px; }
@@ -625,6 +632,79 @@ function holdDuration(ms) {
return `${Math.floor(m / 60)}h ${m % 60}m`;
}
+function drawPnlChart(canvas, points) {
+ if (!canvas || points.length < 2) return;
+ const dpr = window.devicePixelRatio || 1;
+ const W = canvas.offsetWidth || canvas.parentElement?.offsetWidth || 400;
+ const H = 90;
+ canvas.width = W * dpr;
+ canvas.height = H * dpr;
+ const ctx = canvas.getContext('2d');
+ ctx.scale(dpr, dpr);
+
+ const PAD = { top: 8, right: 12, bottom: 8, left: 4 };
+ const cw = W - PAD.left - PAD.right;
+ const ch = H - PAD.top - PAD.bottom;
+
+ const vals = points.map((p) => p.v);
+ const times = points.map((p) => p.t);
+ const minV = Math.min(0, ...vals);
+ const maxV = Math.max(0, ...vals);
+ const rangeV = maxV - minV || 1;
+ const minT = times[0];
+ const maxT = times[times.length - 1];
+ const rangeT = maxT - minT || 1;
+
+ const toX = (t) => PAD.left + ((t - minT) / rangeT) * cw;
+ const toY = (v) => PAD.top + ch - ((v - minV) / rangeV) * ch;
+
+ const finalVal = vals[vals.length - 1];
+ const lineColor = finalVal >= 0 ? '#34d399' : '#f87171';
+ const fillColor = finalVal >= 0 ? 'rgba(52,211,153,0.12)' : 'rgba(248,113,113,0.12)';
+
+ // zero line
+ const zeroY = toY(0);
+ ctx.strokeStyle = 'rgba(255,255,255,0.08)';
+ ctx.lineWidth = 1;
+ ctx.setLineDash([3, 3]);
+ ctx.beginPath();
+ ctx.moveTo(PAD.left, zeroY);
+ ctx.lineTo(PAD.left + cw, zeroY);
+ ctx.stroke();
+ ctx.setLineDash([]);
+
+ // fill under curve
+ ctx.beginPath();
+ ctx.moveTo(toX(times[0]), zeroY);
+ ctx.lineTo(toX(times[0]), toY(vals[0]));
+ for (let i = 1; i < points.length; i++) {
+ const xMid = (toX(times[i - 1]) + toX(times[i])) / 2;
+ ctx.bezierCurveTo(xMid, toY(vals[i - 1]), xMid, toY(vals[i]), toX(times[i]), toY(vals[i]));
+ }
+ ctx.lineTo(toX(times[times.length - 1]), zeroY);
+ ctx.closePath();
+ ctx.fillStyle = fillColor;
+ ctx.fill();
+
+ // line
+ ctx.beginPath();
+ ctx.moveTo(toX(times[0]), toY(vals[0]));
+ for (let i = 1; i < points.length; i++) {
+ const xMid = (toX(times[i - 1]) + toX(times[i])) / 2;
+ ctx.bezierCurveTo(xMid, toY(vals[i - 1]), xMid, toY(vals[i]), toX(times[i]), toY(vals[i]));
+ }
+ ctx.strokeStyle = lineColor;
+ ctx.lineWidth = 2;
+ ctx.lineJoin = 'round';
+ ctx.stroke();
+
+ // final dot
+ ctx.beginPath();
+ ctx.arc(toX(times[times.length - 1]), toY(vals[vals.length - 1]), 3.5, 0, 2 * Math.PI);
+ ctx.fillStyle = lineColor;
+ ctx.fill();
+}
+
let _histLoading = false;
let _histLimit = 25;
@@ -644,12 +724,29 @@ async function loadTradeHistory(root, append = false) {
return;
}
const hasMore = trades.length >= _histLimit;
+ const sorted = [...trades].sort((a, b) => new Date(a.closed_at || 0) - new Date(b.closed_at || 0));
+ const cumPoints = [];
+ let running = 0;
+ for (const t of sorted) {
+ if (t.pnl_sol != null) { running += t.pnl_sol; cumPoints.push({ t: new Date(t.closed_at).getTime(), v: running }); }
+ }
+ const totalPnl = running;
+ const pnlClass = totalPnl > 0 ? 'sn-pos' : totalPnl < 0 ? 'sn-neg' : '';
+ const chartHtml = cumPoints.length >= 2
+ ? `<div class="sn-chart-wrap">
+ <div class="sn-chart-head">
+ <span class="sn-chart-label">Cumulative PnL</span>
+ <span class="sn-chart-val ${pnlClass}">${totalPnl >= 0 ? '+' : ''}${fmtSol(totalPnl)}</span>
+ </div>
+ <canvas class="sn-chart-canvas" id="sn-pnl-canvas" height="90"></canvas>
+ </div>` : '';
mount.innerHTML = `
<div class="sn-hist">
<div class="sn-hist-head">
<h3>Trade History</h3>
<span style="font-size:12px;color:var(--nxt-ink-faint)">${trades.length} closed trade${trades.length !== 1 ? 's' : ''}</span>
</div>
+ ${chartHtml}
<div style="overflow-x:auto">
<table class="sn-hist-table">
<thead>
@@ -668,6 +765,7 @@ async function loadTradeHistory(root, append = false) {
</div>
${hasMore ? `<button class="sn-hist-more" id="sn-hist-more">Load more</button>` : ''}
</div>`;
+ if (cumPoints.length >= 2) drawPnlChart(mount.querySelector('#sn-pnl-canvas'), cumPoints);
if (hasMore) {
mount.querySelector('#sn-hist-more')?.addEventListener('click', () => {
_histLimit += 25;