Spaces:
Running
Running
Download index.html from copytop/top-traders: direct link, hf CLI and curl.
- Browser
- Download file 9.87 kB
-
https://huggingface.co/spaces/copytop/top-traders/resolve/main/index.html
- Command line
-
hf download hf://spaces/copytop/top-traders/index.html
-
curl -L -o index.html https://huggingface.co/spaces/copytop/top-traders/resolve/main/index.html
9.87 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <title>copy.top: top crypto traders live</title> | |
| <meta name="description" content="copy.top tracks what top fomo, pumpfun and Hyperliquid traders buy and sell. Live leaderboard, hot coins and Hyperliquid markets from the public copy.top API."> | |
| <style> | |
| :root { --bg:#0b0f17; --panel:#111827; --line:#1f2937; --text:#e5e7eb; --mute:#9ca3af; --acc:#3b82f6; --up:#22c55e; --down:#ef4444; } | |
| * { box-sizing:border-box; } | |
| body { margin:0; background:var(--bg); color:var(--text); font:14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,sans-serif; } | |
| main { max-width:1100px; margin:0 auto; padding:28px 18px 40px; } | |
| h1 { font-size:24px; margin:0 0 6px; } | |
| a { color:var(--acc); text-decoration:none; } a:hover { text-decoration:underline; } | |
| p.lede { color:var(--mute); margin:0 0 20px; } | |
| .tabs { display:flex; gap:6px; margin-bottom:14px; flex-wrap:wrap; } | |
| .tabs button { background:var(--panel); color:var(--text); border:1px solid var(--line); border-radius:8px; padding:8px 14px; cursor:pointer; font:inherit; } | |
| .tabs button.on { border-color:var(--acc); color:#fff; background:#172554; } | |
| .ctl { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:12px; align-items:center; color:var(--mute); } | |
| select { background:var(--panel); color:var(--text); border:1px solid var(--line); border-radius:6px; padding:6px 8px; font:inherit; } | |
| .wrap { overflow-x:auto; border:1px solid var(--line); border-radius:10px; background:var(--panel); } | |
| table { width:100%; border-collapse:collapse; white-space:nowrap; } | |
| th, td { padding:8px 10px; border-bottom:1px solid var(--line); text-align:left; } | |
| th { color:var(--mute); font-weight:500; font-size:12px; text-transform:lowercase; } | |
| tr:last-child td { border-bottom:0; } | |
| .up { color:var(--up); } .down { color:var(--down); } | |
| .status { color:var(--mute); padding:14px; } | |
| footer { margin-top:26px; color:var(--mute); font-size:13px; } | |
| footer code { background:var(--panel); border:1px solid var(--line); border-radius:4px; padding:1px 5px; color:var(--text); } | |
| </style> | |
| </head> | |
| <body> | |
| <main> | |
| <h1><a href="https://copy.top/?utm_source=huggingface&utm_medium=space">copy.top</a>: top crypto traders, live</h1> | |
| <p class="lede"><a href="https://copy.top/?utm_source=huggingface&utm_medium=space">copy.top</a> tracks what top traders buy and sell on fomo, pumpfun and Hyperliquid, and lets people copy them. This page reads the public <a href="https://copy.top/v1/openapi.json">copy.top API</a> from your browser. Read-only: nothing here places an order. Figures are data, not advice.</p> | |
| <div class="tabs" role="tablist"> | |
| <button data-tab="traders" class="on">top traders</button> | |
| <button data-tab="coins">hot coins</button> | |
| <button data-tab="hl">hyperliquid markets</button> | |
| </div> | |
| <div class="ctl" id="ctl-traders"> | |
| platform <select id="platform"><option value="pumpfun">pumpfun</option><option value="fomo">fomo</option></select> | |
| window <select id="twindow"><option>1d</option><option selected>7d</option><option>30d</option></select> | |
| sort <select id="sort"><option value="total">pnl</option><option value="realized">realized</option><option value="roi">roi</option><option value="winrate">win rate</option><option value="copiers">copiers</option></select> | |
| </div> | |
| <div class="ctl" id="ctl-coins" hidden> | |
| window <select id="cwindow"><option selected>1h</option><option>24h</option></select> | |
| </div> | |
| <div class="ctl" id="ctl-hl" hidden> | |
| category <select id="category"><option value="">all categories</option><option>crypto</option><option>stocks</option><option>indices</option><option>etf</option><option>metals</option><option>energy</option><option>fx</option><option>preipo</option></select> | |
| </div> | |
| <div class="wrap"><table id="tbl"><thead></thead><tbody></tbody></table><div class="status" id="status">loading...</div></div> | |
| <footer> | |
| Data: <a href="https://copy.top/?utm_source=huggingface&utm_medium=space">copy.top</a> 路 | |
| daily snapshots: <a href="https://huggingface.co/datasets/copytop/top-crypto-traders">copytop/top-crypto-traders</a> 路 | |
| Python: <code>pip install copytop</code> 路 | |
| MCP server for AI agents: <code>https://copy.top/mcp</code> (<a href="https://copy.top/agents">docs</a>)<br><br> | |
| copy.top is independent and is not affiliated with fomo, pump.fun or Hyperliquid. Trading crypto is risky and past performance does not predict results. | |
| </footer> | |
| </main> | |
| <script> | |
| (() => { | |
| const API = "https://copy.top/v1/", SITE = "https://copy.top"; | |
| const UTM = "utm_source=huggingface&utm_medium=space"; | |
| const $ = (id) => document.getElementById(id); | |
| let tab = "traders", seq = 0; | |
| const money = (v) => { | |
| if (v === null || v === undefined || v === "") return "-"; | |
| const n = Number(v); if (!isFinite(n)) return "-"; | |
| const a = Math.abs(n), s = n < 0 ? "-" : ""; | |
| if (a >= 1e9) return s + "$" + (a / 1e9).toFixed(1) + "B"; | |
| if (a >= 1e6) return s + "$" + (a / 1e6).toFixed(1) + "M"; | |
| if (a >= 1e3) return s + "$" + (a / 1e3).toFixed(1) + "k"; | |
| return s + "$" + a.toFixed(0); | |
| }; | |
| const pct = (v, ratio) => { | |
| if (v === null || v === undefined) return "-"; | |
| const n = Number(v) * (ratio ? 100 : 1); if (!isFinite(n)) return "-"; | |
| return (n > 0 ? "+" : "") + n.toFixed(1) + "%"; | |
| }; | |
| // every value from the API is third-party text: written with textContent only, never as HTML | |
| const cell = (tr, text, cls) => { const td = document.createElement("td"); td.textContent = text == null ? "" : String(text); if (cls) td.className = cls; tr.appendChild(td); }; | |
| const linkCell = (tr, text, url) => { | |
| const td = document.createElement("td"), a = document.createElement("a"); | |
| a.href = url + (url.includes("?") ? "&" : "?") + UTM; a.target = "_blank"; a.rel = "noopener"; | |
| a.textContent = text; td.appendChild(a); tr.appendChild(td); | |
| }; | |
| const sign = (v) => (v > 0 ? "up" : v < 0 ? "down" : ""); | |
| const seg = (s) => encodeURIComponent(String(s || "")); | |
| async function get(path, params) { | |
| const u = new URL(path, API); | |
| for (const [k, v] of Object.entries(params)) if (v !== null && v !== undefined && v !== "") u.searchParams.set(k, v); | |
| const r = await fetch(u); | |
| if (!r.ok) throw new Error("copy.top API answered " + r.status); | |
| return r.json(); | |
| } | |
| const VIEWS = { | |
| traders: { | |
| cols: ["#", "trader", "name", "pnl", "roi", "win rate", "fair play", "copiers"], | |
| load: () => get("traders", { platform: $("platform").value, window: $("twindow").value, sort: $("sort").value, limit: 25 }), | |
| rows: (d) => (d.traders || []).map((t, i) => (tr) => { | |
| cell(tr, i + 1); linkCell(tr, t.handle, SITE + "/t/" + seg(t.handle)); cell(tr, t.name || ""); | |
| cell(tr, money(t.pnl), sign(t.pnl)); cell(tr, pct(t.roi, true), sign(t.roi)); | |
| cell(tr, t.winRate == null ? "-" : (t.winRate * 100).toFixed(0) + "%"); cell(tr, t.fairPlay || "-"); cell(tr, t.copiers || 0); | |
| }), | |
| }, | |
| coins: { | |
| cols: ["coin", "chain", "mcap", "24h", "traders", "top traders", "top still in", "bought", "sold"], | |
| load: () => get("coins/hot", { window: $("cwindow").value, limit: 20 }), | |
| rows: (d) => (d.coins || []).map((c) => (tr) => { | |
| linkCell(tr, c.symbol || String(c.token || "").slice(0, 8), SITE + "/token/" + seg(c.chain) + "/" + seg(c.token)); | |
| cell(tr, c.chain); cell(tr, money(c.mcap)); cell(tr, pct(c.change24h), sign(c.change24h)); | |
| cell(tr, c.traders); cell(tr, c.topTraders); cell(tr, c.topStillIn); cell(tr, money(c.boughtUsd)); cell(tr, money(c.soldUsd)); | |
| }), | |
| }, | |
| hl: { | |
| cols: ["market", "category", "mark", "24h", "volume 24h", "open interest", "funding 1h", "max lev"], | |
| load: () => get("hyperliquid/markets", { category: $("category").value, limit: 50 }), | |
| rows: (d) => (d.markets || []).map((m) => (tr) => { | |
| linkCell(tr, m.coin, SITE + "/token/hyperliquid/" + seg(m.coin)); | |
| cell(tr, m.category); cell(tr, m.markPx); cell(tr, pct(m.change24h, true), sign(m.change24h)); | |
| cell(tr, money(m.dayNtlVlm)); cell(tr, money(m.openInterestUsd)); | |
| cell(tr, m.fundingHourly == null ? "-" : (m.fundingHourly > 0 ? "+" : "") + (m.fundingHourly * 100).toFixed(4) + "%", sign(m.fundingHourly)); | |
| cell(tr, m.maxLeverage ? m.maxLeverage + "x" : "-"); | |
| }), | |
| }, | |
| }; | |
| async function render() { | |
| const my = ++seq, v = VIEWS[tab]; | |
| const thead = $("tbl").tHead, tbody = $("tbl").tBodies[0]; | |
| $("status").hidden = false; $("status").textContent = "loading..."; | |
| try { | |
| const d = await v.load(); if (my !== seq) return; | |
| thead.replaceChildren(); tbody.replaceChildren(); | |
| const hr = document.createElement("tr"); v.cols.forEach((c) => { const th = document.createElement("th"); th.textContent = c; hr.appendChild(th); }); thead.appendChild(hr); | |
| const rows = v.rows(d); | |
| rows.forEach((fill) => { const tr = document.createElement("tr"); fill(tr); tbody.appendChild(tr); }); | |
| $("status").hidden = rows.length > 0; $("status").textContent = "no rows right now."; | |
| } catch (e) { | |
| if (my !== seq) return; | |
| thead.replaceChildren(); tbody.replaceChildren(); | |
| $("status").textContent = "could not reach the copy.top API, try again in a minute."; | |
| } | |
| } | |
| document.querySelectorAll(".tabs button").forEach((b) => b.addEventListener("click", () => { | |
| tab = b.dataset.tab; | |
| document.querySelectorAll(".tabs button").forEach((x) => x.classList.toggle("on", x === b)); | |
| ["traders", "coins", "hl"].forEach((t) => ($("ctl-" + t).hidden = t !== tab)); | |
| render(); | |
| })); | |
| document.querySelectorAll("select").forEach((s) => s.addEventListener("change", render)); | |
| render(); | |
| })(); | |
| </script> | |
| </body> | |
| </html> | |