// src/market.ts async function fetchData() { const exchanges = await fetch("https://api.prunplanner.org/data/exchanges"); return await exchanges.json(); } function render(prices) { const markets = []; for (const price of prices) { if (price.ExchangeCode !== "IC1" || price.Traded < 100) continue; const spread = (price.Ask - price.Bid) / price.Ask; if (spread < 0.15) continue; markets.push({ material: price.MaterialTicker, bid: price.Bid, ask: price.Ask, spread, traded: price.Traded }); } markets.sort((a, b) => b.spread - a.spread); const fmt = new Intl.NumberFormat(undefined, { maximumFractionDigits: 2 }); const tbody = document.querySelector("tbody"); tbody.innerHTML = ""; for (const market of markets) { const row = document.createElement("tr"); row.innerHTML = `