// Minimal vanilla-JS frontend to poll only positions and render the positions table const qs = (s) => document.querySelector(s); const ptbody = qs('#positions-table tbody'); async function fetchJson(path) { const res = await fetch(path); if (!res.ok) throw new Error('Network response not ok'); return res.json(); } function renderPositions(list) { ptbody.innerHTML = ''; for (const p of list) { const row = document.createElement('tr'); const avg = p.averageCost ?? p.average_cost ?? ''; row.innerHTML = `