|
| 1 | +import Link from "next/link"; |
| 2 | +import { CodeBlock } from "@/components/CodeBlock"; |
| 3 | +import { getNodesPayload } from "@/lib/nodes"; |
| 4 | +import { MARKET_FEE_PCT, OPERATOR_SHARE_PCT, splitPrice } from "@/lib/market"; |
| 5 | + |
| 6 | +export const metadata = { |
| 7 | + title: "market — c0mpute", |
| 8 | + description: `Rent GPU and CPU time from the c0mpute nodes online right now. The node operator keeps ${OPERATOR_SHARE_PCT}% of every job; c0mpute takes a ${MARKET_FEE_PCT}% market fee.`, |
| 9 | + alternates: { canonical: "https://c0mpute.com/market" }, |
| 10 | +}; |
| 11 | + |
| 12 | +// Live supply, not a build-time snapshot. |
| 13 | +export const dynamic = "force-dynamic"; |
| 14 | + |
| 15 | +const EXAMPLES = [1, 5, 20]; |
| 16 | + |
| 17 | +function ago(s: number): string { |
| 18 | + if (s < 90) return `${s}s ago`; |
| 19 | + return `${Math.round(s / 60)}m ago`; |
| 20 | +} |
| 21 | + |
| 22 | +export default async function MarketPage() { |
| 23 | + const p = await getNodesPayload(); |
| 24 | + const gpus = p.nodes.filter((n) => n.class.startsWith("gpu")); |
| 25 | + const cpus = p.nodes.length - gpus.length; |
| 26 | + |
| 27 | + return ( |
| 28 | + <div className="max-w-3xl mx-auto px-6 py-16 space-y-10"> |
| 29 | + <header className="space-y-2"> |
| 30 | + <h1 className="text-2xl font-bold accent">market</h1> |
| 31 | + <p className="comment"> |
| 32 | + // rent compute from the nodes online now · operators keep {OPERATOR_SHARE_PCT}% |
| 33 | + </p> |
| 34 | + </header> |
| 35 | + |
| 36 | + <section className="space-y-3 text-sm leading-7"> |
| 37 | + <h2 className="font-semibold text-[var(--color-fg)]">[ the split ]</h2> |
| 38 | + <p> |
| 39 | + Every job bought through the market pays the node operator{" "} |
| 40 | + <strong className="text-[var(--color-fg)]">{OPERATOR_SHARE_PCT}%</strong> of |
| 41 | + the price. c0mpute keeps a{" "} |
| 42 | + <strong className="text-[var(--color-fg)]">{MARKET_FEE_PCT}% market fee</strong>{" "} |
| 43 | + for matching, billing, settlement and support. Payment-processor fees |
| 44 | + come out of the payment, not out of the operator's share on top. |
| 45 | + </p> |
| 46 | + <table className="w-full text-left border-collapse text-xs"> |
| 47 | + <thead className="text-[var(--color-dim)]"> |
| 48 | + <tr> |
| 49 | + <th className="py-2 pr-6">job price</th> |
| 50 | + <th className="py-2 pr-6">operator gets</th> |
| 51 | + <th className="py-2">c0mpute fee</th> |
| 52 | + </tr> |
| 53 | + </thead> |
| 54 | + <tbody className="divide-y divide-[var(--color-rule)]"> |
| 55 | + {EXAMPLES.map((usd) => { |
| 56 | + const s = splitPrice(usd); |
| 57 | + return ( |
| 58 | + <tr key={usd}> |
| 59 | + <td className="py-2 pr-6">${usd.toFixed(2)}</td> |
| 60 | + <td className="py-2 pr-6 accent">${s.operator.toFixed(2)}</td> |
| 61 | + <td className="py-2 text-[var(--color-dim)]">${s.fee.toFixed(2)}</td> |
| 62 | + </tr> |
| 63 | + ); |
| 64 | + })} |
| 65 | + </tbody> |
| 66 | + </table> |
| 67 | + <p className="text-xs text-[var(--color-dim)] leading-6"> |
| 68 | + The same {MARKET_FEE_PCT}% is the house fee on paid{" "} |
| 69 | + <a href="https://infernetprotocol.com" target="_blank" rel="noopener noreferrer">Infernet</a>{" "} |
| 70 | + inference jobs, which run on these nodes. Two peers dealing directly |
| 71 | + over the open protocol, without the market, pay no protocol fee. →{" "} |
| 72 | + <Link href="/pricing">pricing</Link> |
| 73 | + </p> |
| 74 | + </section> |
| 75 | + |
| 76 | + <section className="space-y-3"> |
| 77 | + <h2 className="text-sm font-semibold">[ GPUs online now ]</h2> |
| 78 | + <p className="text-xs text-[var(--color-dim)] leading-6"> |
| 79 | + {gpus.length} GPU {gpus.length === 1 ? "node" : "nodes"} and {cpus} CPU{" "} |
| 80 | + {cpus === 1 ? "node" : "nodes"} online, read from the signed adverts |
| 81 | + each worker gossips every minute. |
| 82 | + {p.source === "unavailable" ? " The aggregator is not answering right now, so the list is empty." : ""} |
| 83 | + </p> |
| 84 | + {gpus.length === 0 ? ( |
| 85 | + <p className="text-sm text-[var(--color-dim)]">No GPU nodes online at the moment.</p> |
| 86 | + ) : ( |
| 87 | + <div className="overflow-x-auto"> |
| 88 | + <table className="w-full text-left border-collapse text-xs"> |
| 89 | + <thead className="text-[var(--color-dim)]"> |
| 90 | + <tr> |
| 91 | + <th className="py-2 pr-3">node</th> |
| 92 | + <th className="py-2 pr-3">class</th> |
| 93 | + <th className="py-2 pr-3">bench</th> |
| 94 | + <th className="py-2 pr-3">version</th> |
| 95 | + <th className="py-2">seen</th> |
| 96 | + </tr> |
| 97 | + </thead> |
| 98 | + <tbody className="divide-y divide-[var(--color-rule)]"> |
| 99 | + {gpus.map((n, i) => ( |
| 100 | + <tr key={`${n.id}-${i}`}> |
| 101 | + <td className="py-2 pr-3 accent font-mono">{n.id}</td> |
| 102 | + <td className="py-2 pr-3">{n.class}</td> |
| 103 | + <td className="py-2 pr-3">{n.bench_score?.toLocaleString() ?? "-"}</td> |
| 104 | + <td className="py-2 pr-3 text-[var(--color-dim)]">{n.version ?? "-"}</td> |
| 105 | + <td className="py-2 text-[var(--color-dim)]">{ago(n.last_seen_s)}</td> |
| 106 | + </tr> |
| 107 | + ))} |
| 108 | + </tbody> |
| 109 | + </table> |
| 110 | + </div> |
| 111 | + )} |
| 112 | + <p className="text-xs text-[var(--color-dim)]"> |
| 113 | + → <Link href="/nodes">every node</Link> · <a href="/api/nodes">/api/nodes</a> (JSON) |
| 114 | + </p> |
| 115 | + </section> |
| 116 | + |
| 117 | + <section className="space-y-3 text-sm leading-7"> |
| 118 | + <h2 className="font-semibold text-[var(--color-fg)]">[ rent ]</h2> |
| 119 | + <p> |
| 120 | + <strong className="text-[var(--color-fg)]">GPU inference.</strong> Paid |
| 121 | + model inference runs through{" "} |
| 122 | + <a href="https://infernetprotocol.com" target="_blank" rel="noopener noreferrer">Infernet</a>{" "} |
| 123 | + on these nodes, billed through{" "} |
| 124 | + <a href="https://coinpayportal.com" target="_blank" rel="noopener noreferrer">CoinPay</a>{" "} |
| 125 | + in crypto or PayPal. |
| 126 | + </p> |
| 127 | + <p> |
| 128 | + <strong className="text-[var(--color-fg)]">Batch jobs.</strong> Submit |
| 129 | + from the CLI with a price cap; nodes quote under it and the job pays |
| 130 | + out when the result validates. |
| 131 | + </p> |
| 132 | + <CodeBlock>{`$ curl -fsSL https://c0mpute.com/install.sh | sh |
| 133 | +$ c0mpute transcode submit input.mov --preset hls --max-price 1.25`}</CodeBlock> |
| 134 | + </section> |
| 135 | + |
| 136 | + <section className="space-y-3 text-sm leading-7"> |
| 137 | + <h2 className="font-semibold text-[var(--color-fg)]">[ sell your GPU ]</h2> |
| 138 | + <p> |
| 139 | + Install the node, set where your {OPERATOR_SHARE_PCT}% lands, and it |
| 140 | + shows up here as soon as it advertises. |
| 141 | + </p> |
| 142 | + <CodeBlock>{`$ curl -fsSL https://c0mpute.com/install.sh | sh |
| 143 | +$ infernet payout set USDC 0xYourAddress --network polygon`}</CodeBlock> |
| 144 | + <p className="text-xs text-[var(--color-dim)]"> |
| 145 | + → <Link href="/providers">running a node</Link> |
| 146 | + </p> |
| 147 | + </section> |
| 148 | + </div> |
| 149 | + ); |
| 150 | +} |
0 commit comments