<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: abacusmarketon</title>
    <description>The latest articles on DEV Community by abacusmarketon (@abacusmarketon).</description>
    <link>https://dev.to/abacusmarketon</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4260873%2Fa8587bbe-0559-4d71-afc9-afb76aec71ec.png</url>
      <title>DEV Community: abacusmarketon</title>
      <link>https://dev.to/abacusmarketon</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abacusmarketon"/>
    <language>en</language>
    <item>
      <title>I mapped the crypto market into 14 long-form pages with a 400-line static site generator</title>
      <dc:creator>abacusmarketon</dc:creator>
      <pubDate>Mon, 23 Nov 2026 15:13:53 +0000</pubDate>
      <link>https://dev.to/abacusmarketon/i-mapped-the-crypto-market-into-14-long-form-pages-with-a-400-line-static-site-generator-li</link>
      <guid>https://dev.to/abacusmarketon/i-mapped-the-crypto-market-into-14-long-form-pages-with-a-400-line-static-site-generator-li</guid>
      <description>&lt;p&gt;Crypto market sites tend to be either a table of 10,000 tokens sorted by market cap, or a blog post called "Top 10 Coins to Buy". I wanted the thing in between: a &lt;strong&gt;reference&lt;/strong&gt;, organised by what each asset is &lt;em&gt;for&lt;/em&gt;, with real numbers, honest labels, and enough text per page to actually learn something.&lt;/p&gt;

&lt;p&gt;The result is &lt;strong&gt;Abacus Markets&lt;/strong&gt;: 14 pages, each a 500–800-word article with two or three charts and a table. Sectors, Layer 1s, Layer 2s, stablecoins, DeFi, memecoins, exchange tokens, dominance, cycles, a how-to-evaluate checklist, a ranked list of the industry's ten largest losses, and a glossary.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🔗 Live: &lt;a href="https://github.com/hayrolu78/abacus" rel="noopener noreferrer"&gt;https://github.com/hayrolu78/abacus&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This post is about the three decisions that kept it small.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Two kinds of data, kept apart
&lt;/h2&gt;

&lt;p&gt;A market site has data that changes every second and data that changes every quarter, and mixing them is how you get a page that is simultaneously "live" and wrong.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Live:&lt;/strong&gt; 24 coins (price, cap, volume, 7-day sparkline) and global totals from CoinGecko's free API. Fetched in the browser on each load through &lt;code&gt;Promise.allSettled&lt;/code&gt;, so a failure in one endpoint doesn't block the other. If it works, the market strip says &lt;code&gt;live · CoinGecko&lt;/code&gt;; if not, &lt;code&gt;snapshot 2026-11-23&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Editorial:&lt;/strong&gt; sector sizes, TVL per protocol, stablecoin supply by issuer, L1 specs, incident losses, and all historical series. These live in one JSON file, are rounded, and every chart that uses them says "approximate" in the caption. A &lt;code&gt;fetch-data.js&lt;/code&gt; script refreshes the live part of the file and &lt;em&gt;preserves&lt;/em&gt; the editorial part — including the sector label on each coin, which is the one thing an API can't tell you.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;sectorOf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fromEntries&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;coins&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sector&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;coins&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;live&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;sectorOf&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="s1"&gt;'Other'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;missing&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Assign a sector to new entrants:'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;missing&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When a new coin enters the top 24, the script tells me to classify it. That's the whole editorial workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Page content lives in the build script
&lt;/h2&gt;

&lt;p&gt;Fourteen pages × 600 words × tables × charts is too much to template cleanly with a generic engine and too little to justify a CMS. So each page is a function call in &lt;code&gt;build.js&lt;/code&gt; with its content as a template literal, and small helpers for the repeated parts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;chart&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;caption&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
  &lt;span class="sb"&gt;`&amp;lt;div class="panel"&amp;gt;&amp;lt;h3&amp;gt;${title}&amp;lt;/h3&amp;gt;
     &amp;lt;div class="chart-wrap"&amp;gt;&amp;lt;canvas id="${id}" aria-label="${esc(title)}"&amp;gt;&amp;lt;/canvas&amp;gt;&amp;lt;/div&amp;gt;
     &amp;lt;p class="chart-caption"&amp;gt;${caption}&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;table&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;head&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="cm"&gt;/* thead/tbody with .num and .wrap cells */&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;toc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="cm"&gt;/* sticky "On this page" sidebar */&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tables are generated from the JSON (&lt;code&gt;D.layer1.map(...)&lt;/code&gt;), so the Layer-1 comparison table and the Layer-1 charts can't disagree. The prose is the one thing written by hand, and it's next to the data it describes.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;fill()&lt;/code&gt; — the templating engine — is still one line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;fill&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;\&lt;span class="p"&gt;{&lt;/span&gt;\&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;\&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;\&lt;span class="p"&gt;}&lt;/span&gt;\&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Charts that follow rules
&lt;/h2&gt;

&lt;p&gt;Twenty-eight charts across the site, all Chart.js, all built from four helpers (&lt;code&gt;hbar&lt;/code&gt;, &lt;code&gt;lines&lt;/code&gt;, &lt;code&gt;bar&lt;/code&gt;, &lt;code&gt;line&lt;/code&gt;). A few rules I enforced and would recommend:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Horizontal bars for anything categorical with long labels&lt;/strong&gt; — sectors, protocols, chains. Set &lt;code&gt;ticks.autoSkip = false&lt;/code&gt; on the category axis or Chart.js will quietly drop half your labels.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Log scale where the data spans orders of magnitude&lt;/strong&gt;: total cap since 2013, fees per transfer ($0.002 to $1.50), subsidy by era. Custom tick callbacks so only powers of ten get labelled.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One axis per chart.&lt;/strong&gt; When I wanted TVL and fees together, I made a ratio (market cap ÷ fees) and charted that instead of a dual axis.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Colors from CSS variables&lt;/strong&gt;, read with &lt;code&gt;getComputedStyle&lt;/code&gt; at render time. The theme toggle flips &lt;code&gt;data-theme&lt;/code&gt; and rebuilds the charts; the light and dark palettes are both hand-selected and colorblind-validated, assigned in a fixed order so the same sector is the same color on every page.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-series lines get a legend &lt;em&gt;and&lt;/em&gt; direct end labels&lt;/strong&gt; (a tiny plugin that draws &lt;code&gt;dataset.label&lt;/code&gt; at the last point), so identity never depends on color alone.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Every chart has a caption, and the numbers also exist in a table.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Things that bit me
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;code&gt;'&lt;/code&gt; inside a single-quoted template-literal argument. Not a tooling problem; a me problem. The link checker in &lt;code&gt;npm test&lt;/code&gt; didn't catch it because the build didn't run. Lesson: run the build in CI before the check, and let it fail loudly.&lt;/li&gt;
&lt;li&gt;CoinGecko's &lt;code&gt;/global&lt;/code&gt; and &lt;code&gt;/coins/markets&lt;/code&gt; have different rate limits; fetching them in parallel with &lt;code&gt;allSettled&lt;/code&gt; and merging whatever arrives was more robust than sequencing them.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;white-space: nowrap&lt;/code&gt; on table cells is right for numbers and wrong for the "note" column. One &lt;code&gt;.wrap&lt;/code&gt; class fixed every table.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What it's not
&lt;/h2&gt;

&lt;p&gt;It's not a price-prediction site, it doesn't have affiliate links, and the risks page is deliberately the most detailed one. If you fork it, the data file is the product; the code is 400 lines of plumbing you'll probably never need to touch.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Not investment advice. Live data from CoinGecko; everything else approximate and labelled.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>cryptocurrency</category>
    </item>
  </channel>
</rss>
