// The rate card of the Idle GPU cloud. These are TARGET rates: what Idle shows while no provider is connected, // and for a GPU the provider does not list. On their own they rent nothing: `available` is 0 on every line here. // When a provider is configured (lib/app.mjs), the rates served are the provider's live prices plus Idle's margin, // and this card only gives the ids, the names and the order. // A rate is in USD per GPU hour; a rental is billed per second, in credits bought with USDC on Elysium. export const GPUS = [ { id: "rtx-4090", name: "RTX 4090", vram: 24, usdPerHour: 0.59 }, { id: "rtx-5090", name: "RTX 5090", vram: 32, usdPerHour: 0.79 }, { id: "l40s", name: "L40S", vram: 48, usdPerHour: 0.75 }, { id: "a100", name: "A100 SXM", vram: 80, usdPerHour: 1.19 }, { id: "h100", name: "H100 SXM", vram: 80, usdPerHour: 2.69 }, { id: "h200", name: "H200 SXM", vram: 141, usdPerHour: 3.59 }, { id: "b200", name: "B200", vram: 180, usdPerHour: 5.49 }, ]; /** * The rate card alone never opens rentals. Whether rentals are open is decided in lib/app.mjs, from the * configuration: a real provider, a treasury, a session secret and a state store, all four. */ export const RENTALS_OPEN = false; export const MIN_SECONDS = 1; export const MAX_SECONDS = 30 * 86_400; const round = (x, d) => Math.round(x * 10 ** d) / 10 ** d; export function findGpu(id) { return GPUS.find((g) => g.id === String(id ?? "").toLowerCase()) ?? null; } /** * What `seconds` on one GPU costs at the target rate. USDC is rounded up to its 6 decimals, * as a meter that bills per second would. `hypeMid` (USD per HYPE) may be null: then no HYPE figure. */ export function quote(gpu, seconds, hypeMid) { const s = Number(seconds); if (!gpu) throw new RangeError("unknown gpu"); if (!Number.isInteger(s) || s < MIN_SECONDS || s > MAX_SECONDS) throw new RangeError(`seconds must be a whole number from ${MIN_SECONDS} to ${MAX_SECONDS}`); const usdPerSecond = gpu.usdPerHour / 3600; const usd = Math.ceil(usdPerSecond * s * 1e6 - 1e-9) / 1e6; const hype = hypeMid > 0 ? round(usd / hypeMid, 6) : null; return { gpu: gpu.id, seconds: s, usdPerHour: gpu.usdPerHour, usdPerSecond: round(usdPerSecond, 8), usd, hype }; } /** The rate card with the live HYPE conversion next to each rate. */ export function card(hypeMid) { return GPUS.map((g) => ({ ...g, usdPerSecond: round(g.usdPerHour / 3600, 8), hypePerHour: hypeMid > 0 ? round(g.usdPerHour / hypeMid, 6) : null, available: 0, })); }