<?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: a353551071</title>
    <description>The latest articles on DEV Community by a353551071 (@a353551071).</description>
    <link>https://dev.to/a353551071</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%2F4068758%2F6995e0f8-1b9a-4641-8d99-565663720faf.png</url>
      <title>DEV Community: a353551071</title>
      <link>https://dev.to/a353551071</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/a353551071"/>
    <language>en</language>
    <item>
      <title>I forked an open-source game wiki template — the hard part was keeping it correct</title>
      <dc:creator>a353551071</dc:creator>
      <pubDate>Thu, 27 Aug 2026 01:57:12 +0000</pubDate>
      <link>https://dev.to/a353551071/i-forked-an-open-source-game-wiki-template-the-hard-part-was-keeping-it-correct-1aki</link>
      <guid>https://dev.to/a353551071/i-forked-an-open-source-game-wiki-template-the-hard-part-was-keeping-it-correct-1aki</guid>
      <description>&lt;p&gt;Every game wiki has the same failure mode, and it isn't hosting or search — it's &lt;strong&gt;rot&lt;/strong&gt;. A roguelite ships a balance patch, the "best build" everyone recommends gets quietly nerfed, and the wiki keeps presenting last month's meta as truth. Players burn a run on stale advice, blame the site, and never come back.&lt;/p&gt;

&lt;p&gt;Sephiria is a new action roguelite that patches every few weeks, which makes it a worst case for wiki rot. So when I built &lt;a href="https://sephiriabuilds.xyz" rel="noopener noreferrer"&gt;sephiriabuilds.xyz&lt;/a&gt;, I spent more time on the &lt;em&gt;correctness pipeline&lt;/em&gt; than on the visual design. This post is the parts worth stealing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start from a template, then strip it honest
&lt;/h2&gt;

&lt;p&gt;I started from &lt;strong&gt;AnvilWiki&lt;/strong&gt; — an open-source Astro 5 game-wiki template (MIT). It gives you content collections, tag pages, breadcrumbs, sitemap, and a clean card layout out of the box, which saves a week of plumbing.&lt;/p&gt;

&lt;p&gt;The first real job was deletion, not addition. The template ships with demo content for its original game — placeholder boss pages, a fake "video guides" section with a YouTube ID that doesn't exist, promo blocks for games the template never covered. All of it gone. A wiki that shows one piece of fabricated content teaches the reader that none of it can be trusted.&lt;/p&gt;

&lt;p&gt;What survived the strip is what a wiki actually is: content collections for builds / weapons / guides, tags as a free secondary navigation layer, and per-page frontmatter I could extend.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mechanism 1: every page carries the patch it was written against
&lt;/h2&gt;

&lt;p&gt;Each piece of content declares the game version it targets:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Biryuu&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Katana&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;—&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Crit&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Build"&lt;/span&gt;
&lt;span class="na"&gt;gameVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;1.0.25"&lt;/span&gt;
&lt;span class="na"&gt;evidence&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;video-verified"&lt;/span&gt;
&lt;span class="na"&gt;lastModified&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;2026-08-26"&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;gameVersion&lt;/code&gt; renders as a version badge next to the title; &lt;code&gt;lastModified&lt;/code&gt; renders in a trust bar under it. A reader landing from search can immediately see &lt;em&gt;"written for 1.0.25, updated three days ago"&lt;/em&gt; versus &lt;em&gt;"written for 1.0.18, untouched for a month"&lt;/em&gt; — which, for a game that patches monthly, is the difference between advice and archaeology.&lt;/p&gt;

&lt;p&gt;This also disciplines me as the author. When a patch lands, I don't "refresh the site"; I open the pages whose mechanics the patch notes touched, bump their version stamp, and leave everything else alone. The &lt;a href="https://sephiriabuilds.xyz/builds/best-builds" rel="noopener noreferrer"&gt;Sephiria builds&lt;/a&gt; hub and the &lt;a href="https://sephiriabuilds.xyz/guides/weapon-tier-list" rel="noopener noreferrer"&gt;weapon tier list&lt;/a&gt; are the most patch-sensitive pages, so they get reviewed every time; a &lt;a href="https://sephiriabuilds.xyz/guides/beginner-guide" rel="noopener noreferrer"&gt;beginner guide&lt;/a&gt; explaining core mechanics rots much slower and is reviewed far less often.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mechanism 2: grade the evidence, don't just cite it
&lt;/h2&gt;

&lt;p&gt;Build guides have an evidence problem: half of what circulates on Reddit and YouTube is one player's opinion from two patches ago. So every recommendation on the site carries an explicit evidence grade:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;video-verified&lt;/strong&gt; — someone demonstrated it on camera in the current patch&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;community-reported&lt;/strong&gt; — multiple independent players claim it works, no video yet&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;tested-this-patch&lt;/strong&gt; — I reproduced it myself&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;carried-over&lt;/strong&gt; — verified in an older patch, not yet re-tested after balance changes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This has a nice property: the grade is a to-do list. Anything sitting at &lt;code&gt;carried-over&lt;/code&gt; after a balance patch is exactly the page that needs attention next.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mechanism 3: make re-crawl instant
&lt;/h2&gt;

&lt;p&gt;When a patch drops and I update pages, I want search engines back the same day, not in three weeks. Three boring pieces of plumbing do that:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Static generation.&lt;/strong&gt; The whole site is SSG — a patch update is one rebuild, deploy takes seconds, and there's no server state to worry about.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sitemap &lt;code&gt;lastmod&lt;/code&gt; wired to &lt;code&gt;lastModified&lt;/code&gt;.&lt;/strong&gt; Not a static build date — the actual content date, so crawlers see which URLs genuinely changed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IndexNow.&lt;/strong&gt; After each deploy, a tiny script pings the updated URLs to IndexNow (Bing, Yandex, and friends), which accepts them within seconds. No quota anxiety, no waiting for organic re-crawl.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What I'd tell past me
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Launch thin, launch honest.&lt;/strong&gt; The site went live with four hand-written pages — a best-builds comparison, a tier list, a beginner guide, and one deep &lt;a href="https://sephiriabuilds.xyz/builds/biryuu-katana" rel="noopener noreferrer"&gt;weapon build page&lt;/a&gt; — each with version stamps and evidence grades, rather than forty half-finished stubs. For search, four real pages beat forty hollow ones.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The template saves you a week of plumbing, not a week of judgment.&lt;/strong&gt; The demo content, the fake sections, the "works for any game" defaults — deleting all of it &lt;em&gt;was&lt;/em&gt; the product decision.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Design for the patch, not the launch.&lt;/strong&gt; Every mechanism above exists because the game changes monthly. If your content has a shelf life, build the expiry date into the page itself.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The site is live and growing a few pages a week. Too early for traffic numbers — but the pipeline means that when a patch lands at 10am, the wiki is correct again by lunch.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>astro</category>
      <category>webdev</category>
      <category>gamedev</category>
    </item>
    <item>
      <title>I built a free dividend calculator suite (no signup, open-source math)</title>
      <dc:creator>a353551071</dc:creator>
      <pubDate>Sun, 23 Aug 2026 02:45:59 +0000</pubDate>
      <link>https://dev.to/a353551071/i-built-a-free-dividend-calculator-suite-no-signup-open-source-math-2a9p</link>
      <guid>https://dev.to/a353551071/i-built-a-free-dividend-calculator-suite-no-signup-open-source-math-2a9p</guid>
      <description>&lt;p&gt;Every "free" dividend calculator I tried wanted an email, a signup, or a trial. The math behind all of them is public — yield, payout ratio, reinvestment compounding — so I built a &lt;a href="https://www.dividendpayoutcalculator.com" rel="noopener noreferrer"&gt;dividend payout calculator&lt;/a&gt; that's actually free, runs entirely in the browser, and open-sources the engine.&lt;/p&gt;

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

&lt;p&gt;A suite of focused calculators rather than one mega-tool:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://www.dividendpayoutcalculator.com/calculators/dividend-yield-calculator" rel="noopener noreferrer"&gt;Dividend yield&lt;/a&gt;&lt;/strong&gt; + &lt;strong&gt;payout ratio&lt;/strong&gt; — the two-number sustainability check.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://www.dividendpayoutcalculator.com/calculators/drip-calculator" rel="noopener noreferrer"&gt;DRIP calculator&lt;/a&gt;&lt;/strong&gt; — year-by-year reinvestment with a results table and chart.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://www.dividendpayoutcalculator.com/calculators/monthly-dividend-calculator" rel="noopener noreferrer"&gt;Monthly dividend calculator&lt;/a&gt;&lt;/strong&gt; — work backwards from the monthly income you want to the capital required.&lt;/li&gt;
&lt;li&gt;Dedicated ETF calculators for &lt;strong&gt;&lt;a href="https://www.dividendpayoutcalculator.com/calculators/schd-dividend-calculator" rel="noopener noreferrer"&gt;SCHD&lt;/a&gt;&lt;/strong&gt; (quarterly dividend growth) and &lt;strong&gt;&lt;a href="https://www.dividendpayoutcalculator.com/calculators/qqqi-dividend-calculator" rel="noopener noreferrer"&gt;QQQI&lt;/a&gt;&lt;/strong&gt; (monthly income) — plus a live &lt;strong&gt;&lt;a href="https://www.dividendpayoutcalculator.com/blog/qqqi-dividend-calendar" rel="noopener noreferrer"&gt;QQQI dividend calendar&lt;/a&gt;&lt;/strong&gt; with recent distributions and the next projected ex-dividend date.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No account, no paywall, no "trial expired." It's a static site — the math is client-side.&lt;/p&gt;

&lt;h2&gt;
  
  
  The engine: a tiny open-source library
&lt;/h2&gt;

&lt;p&gt;The interesting part was never the UI — it was the math. So I pulled every formula into one zero-dependency TypeScript library: &lt;strong&gt;&lt;a href="https://github.com/a353551071/dividend-math" rel="noopener noreferrer"&gt;dividend-math&lt;/a&gt;&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;dividendYield&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;payoutRatio&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;monthlyDividendIncome&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;dripCalculator&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dividend-math&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A few engineering choices worth calling out:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pure functions everywhere.&lt;/strong&gt; Every formula is a pure function with no I/O — &lt;code&gt;dividendYield&lt;/code&gt;, &lt;code&gt;payoutRatio&lt;/code&gt;, &lt;code&gt;monthlyDividendIncome&lt;/code&gt;, &lt;code&gt;dripCalculator&lt;/code&gt;. That makes the edge cases (zero price, zero earnings, the &lt;code&gt;g = 0&lt;/code&gt; branch in the cumulative-dividend geometric series) easy to pin down with &lt;a href="https://github.com/a353551071/dividend-math/blob/main/tests/dividend.test.ts" rel="noopener noreferrer"&gt;16 unit tests&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One source of truth.&lt;/strong&gt; The same &lt;code&gt;dripCalculator&lt;/code&gt; drives the DRIP page, the SCHD and QQQI ETF calculators, and the monthly-income page. One implementation, no drift between pages.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plain-number inputs.&lt;/strong&gt; Percentages are plain numbers (&lt;code&gt;5&lt;/code&gt; for 5%), money is dollars. Bad inputs fail loudly (&lt;code&gt;NaN&lt;/code&gt;) instead of returning plausible-looking nonsense.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Static, no backend.&lt;/strong&gt; It's a statically-generated site — all computation happens in your browser, nothing is sent anywhere. Which is also why it can be free and sign-up-free forever.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why open-source it
&lt;/h2&gt;

&lt;p&gt;Two reasons. First, the math is commodity knowledge — yield, payout, reinvestment — there's no secret sauce to hoard. Second, open-sourcing it is the credibility move for a finance tool: you can read exactly what the calculator is doing instead of trusting a black box. The library is on npm (&lt;code&gt;npm install dividend-math&lt;/code&gt;) and the source is up: &lt;a href="https://github.com/a353551071/dividend-math" rel="noopener noreferrer"&gt;github.com/a353551071/dividend-math&lt;/a&gt;, MIT.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;App:&lt;/strong&gt; &lt;a href="https://www.dividendpayoutcalculator.com" rel="noopener noreferrer"&gt;dividendpayoutcalculator.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Library (npm):&lt;/strong&gt; &lt;code&gt;npm install dividend-math&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; &lt;a href="https://github.com/a353551071/dividend-math" rel="noopener noreferrer"&gt;github.com/a353551071/dividend-math&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Engineering / showdev post, not financial advice. The calculators model scenarios; they don't recommend securities.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you've got feedback — a calculator that's missing, a model you'd extend (tax drag? FX? yield-on-cost columns?) — I'd genuinely like to hear it. Building in public.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>finance</category>
      <category>typescript</category>
      <category>opensource</category>
    </item>
    <item>
      <title>What's a "good" dividend yield? You need a second number</title>
      <dc:creator>a353551071</dc:creator>
      <pubDate>Fri, 21 Aug 2026 03:46:54 +0000</pubDate>
      <link>https://dev.to/a353551071/whats-a-good-dividend-yield-you-need-a-second-number-h2k</link>
      <guid>https://dev.to/a353551071/whats-a-good-dividend-yield-you-need-a-second-number-h2k</guid>
      <description>&lt;p&gt;Ask "is this a good dividend yield?" and you've already asked half a question. Yield on its own is a ratio — annual dividend ÷ price — and a ratio can move for two very different reasons: the dividend went up, &lt;strong&gt;or the price went down&lt;/strong&gt;. A crashing price inflates the yield and makes a deteriorating company look like a bargain.&lt;/p&gt;

&lt;p&gt;To read a dividend you need a second number: the &lt;strong&gt;payout ratio&lt;/strong&gt; — dividend ÷ earnings. That's the sustainability check. The two together are what I built the &lt;a href="https://www.dividendpayoutcalculator.com/calculators/dividend-yield-calculator" rel="noopener noreferrer"&gt;dividend yield calculator&lt;/a&gt; and &lt;a href="https://www.dividendpayoutcalculator.com/calculators/dividend-payout-ratio-calculator" rel="noopener noreferrer"&gt;payout ratio calculator&lt;/a&gt; to show side by side. Both run off the same open-source library, &lt;strong&gt;&lt;a href="https://github.com/a353551071/dividend-math" rel="noopener noreferrer"&gt;dividend-math&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two functions, two different questions
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;dividendYield&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;payoutRatio&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dividend-math&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Yield: income relative to the price you pay&lt;/span&gt;
&lt;span class="nf"&gt;dividendYield&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;annualDividendPerShare&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;2.8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt; &lt;span class="c1"&gt;// → 3.5 (%)&lt;/span&gt;

&lt;span class="c1"&gt;// Payout ratio: dividend relative to what the company actually earns&lt;/span&gt;
&lt;span class="nf"&gt;payoutRatio&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;dividendPerShare&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;earningsPerShare&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt; &lt;span class="c1"&gt;// → 40 (%)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;dividendYield&lt;/code&gt; tells you the cash flow per dollar invested. &lt;code&gt;payoutRatio&lt;/code&gt; tells you whether that cash flow is actually affordable. One without the other is a story half-told.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reading the pair
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;7% yield at a 95% payout ratio&lt;/strong&gt; — the dividend eats almost everything the company earns. No room to grow it, and any earnings dip puts the payout at risk. The high yield is often the market pricing in a cut.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;3.5% yield at a 40% payout ratio&lt;/strong&gt; — modest income, but the dividend is covered two-and-a-half times over. There's headroom to raise it (which is how a 3.5% payer becomes a 6% yield-on-cost over a decade), and the payout survives a bad year.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Same headline yield, opposite stories. The payout ratio is the lie detector. That's why a "good" yield for something you intend to hold is usually in the 3–5% range with a healthy payout ratio — boring, sustainable, and able to grow — rather than a double-digit yield propped up by an unsustainable payout or a collapsing share price.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pure functions, tested edges
&lt;/h2&gt;

&lt;p&gt;Both are pure functions: &lt;code&gt;dividendYield&lt;/code&gt; returns &lt;code&gt;NaN&lt;/code&gt; for a zero price (fail loud, don't return a pretty &lt;code&gt;Infinity&lt;/code&gt;), &lt;code&gt;payoutRatio&lt;/code&gt; returns &lt;code&gt;NaN&lt;/code&gt; for zero earnings. Edge behavior is pinned by &lt;a href="https://github.com/a353551071/dividend-math/blob/main/tests/dividend.test.ts" rel="noopener noreferrer"&gt;unit tests&lt;/a&gt;, and the same functions drive every calculator page on &lt;a href="https://www.dividendpayoutcalculator.com" rel="noopener noreferrer"&gt;dividendpayoutcalculator.com&lt;/a&gt; — yield, payout, growth, DRIP, SCHD, and the &lt;a href="https://www.dividendpayoutcalculator.com/calculators/qqqi-dividend-calculator" rel="noopener noreferrer"&gt;QQQI dividend calculator&lt;/a&gt;. One implementation, no drift.&lt;/p&gt;

&lt;h2&gt;
  
  
  Run it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://www.dividendpayoutcalculator.com/calculators/dividend-yield-calculator" rel="noopener noreferrer"&gt;Dividend yield calculator&lt;/a&gt;&lt;/strong&gt; + &lt;strong&gt;&lt;a href="https://www.dividendpayoutcalculator.com/calculators/dividend-payout-ratio-calculator" rel="noopener noreferrer"&gt;payout ratio calculator&lt;/a&gt;&lt;/strong&gt; — pair them, no sign-up.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Library (npm):&lt;/strong&gt; &lt;code&gt;npm install dividend-math&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; &lt;a href="https://github.com/a353551071/dividend-math" rel="noopener noreferrer"&gt;github.com/a353551071/dividend-math&lt;/a&gt; (MIT)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Math/engineering post, not financial advice. Payout ratios differ by sector (REITs, MLPs run high legitimately); model scenarios, don't pick tickers.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;What payout-ratio threshold do you treat as a yellow flag — 60%, 75%, higher for certain sectors? Always found the sector-dependence is where the simple rules break down.&lt;/p&gt;

</description>
      <category>finance</category>
      <category>typescript</category>
      <category>math</category>
      <category>opensource</category>
    </item>
    <item>
      <title>How much do you need to earn $1,000 a month in dividends?</title>
      <dc:creator>a353551071</dc:creator>
      <pubDate>Wed, 19 Aug 2026 03:59:31 +0000</pubDate>
      <link>https://dev.to/a353551071/how-much-do-you-need-to-earn-1000-a-month-in-dividends-25d3</link>
      <guid>https://dev.to/a353551071/how-much-do-you-need-to-earn-1000-a-month-in-dividends-25d3</guid>
      <description>&lt;p&gt;Most dividend calculators go forward: "I have $X, what do I get?" The question people actually obsess over is the inverse: &lt;strong&gt;"I want $1,000 a month in dividends — how much do I need?"&lt;/strong&gt; That's a one-line formula, and the answer is where a lot of bad decisions start.&lt;/p&gt;

&lt;p&gt;I built a &lt;a href="https://www.dividendpayoutcalculator.com/calculators/monthly-dividend-calculator" rel="noopener noreferrer"&gt;monthly dividend calculator&lt;/a&gt; around exactly that inverse, powered by the open-source library &lt;strong&gt;&lt;a href="https://github.com/a353551071/dividend-math" rel="noopener noreferrer"&gt;dividend-math&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The inverse, in one line
&lt;/h2&gt;

&lt;p&gt;Capital needed = (target monthly income × 12) ÷ yield.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Solve for the capital that throws off a target monthly income at a given yield&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;capitalFor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;monthlyIncome&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;yieldPct&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&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="nx"&gt;monthlyIncome&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;12&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="nx"&gt;yieldPct&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nf"&gt;capitalFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;   &lt;span class="c1"&gt;// → 300,000&lt;/span&gt;
&lt;span class="nf"&gt;capitalFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;   &lt;span class="c1"&gt;// → 200,000&lt;/span&gt;
&lt;span class="nf"&gt;capitalFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// → ~92,308&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And going the other direction — the library's actual function — gives you the monthly income on a real position:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;monthlyDividendIncome&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dividend-math&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nf"&gt;monthlyDividendIncome&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;investment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;300000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;dividendYieldPct&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt; &lt;span class="c1"&gt;// → 1,000/month&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pure function, plain-number inputs (&lt;code&gt;4&lt;/code&gt; for 4%), money in dollars. Same formula on both sides of the equals sign.&lt;/p&gt;

&lt;h2&gt;
  
  
  The trap in the formula
&lt;/h2&gt;

&lt;p&gt;Look at the three outputs above. The capital you "need" drops fast as the yield rises — $300k → $200k → $92k. So the formula whispers the same thing to everyone: &lt;em&gt;just chase a higher yield and you can retire on less.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That's the trap. The yield that lets you hit the number with less capital is the yield carrying the most risk — an unsustainable payout, a price that's been collapsing (yield = dividend ÷ price, remember), or an option-income fund eroding its own NAV (run a covered-call monthly payer through the &lt;a href="https://www.dividendpayoutcalculator.com/calculators/qqqi-dividend-calculator" rel="noopener noreferrer"&gt;QQQI dividend calculator&lt;/a&gt; and you'll see how variable that "monthly" number really is). The &lt;a href="https://www.dividendpayoutcalculator.com/calculators/monthly-dividend-calculator" rel="noopener noreferrer"&gt;monthly dividend calculator&lt;/a&gt; on &lt;a href="https://www.dividendpayoutcalculator.com" rel="noopener noreferrer"&gt;dividendpayoutcalculator.com&lt;/a&gt; deliberately shows the income &lt;em&gt;and&lt;/em&gt; the payout ratio together, because a monthly number you can't trust is worse than a smaller one you can.&lt;/p&gt;

&lt;p&gt;The honest version of the formula: pick a yield you'd actually trust for a decade (often 3–5% for growth payers), and accept the capital that requires. Bending the yield to fit a smaller bankroll is working backwards from the wrong variable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Run it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Live &lt;a href="https://www.dividendpayoutcalculator.com/calculators/monthly-dividend-calculator" rel="noopener noreferrer"&gt;monthly dividend calculator&lt;/a&gt;:&lt;/strong&gt; work backwards from the income you want, no sign-up.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Library (npm):&lt;/strong&gt; &lt;code&gt;npm install dividend-math&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; &lt;a href="https://github.com/a353551071/dividend-math" rel="noopener noreferrer"&gt;github.com/a353551071/dividend-math&lt;/a&gt; (MIT)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Math post, not financial advice. "Monthly income" targets look tidy in a spreadsheet; real yields fluctuate and payouts get cut. Model scenarios, don't pick tickers.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;What yield do you assume when you do this back-of-the-envelope — a conservative 3.5%, or do you let a high-yield fund do the heavy lifting? Curious where people actually land.&lt;/p&gt;

</description>
      <category>finance</category>
      <category>typescript</category>
      <category>opensource</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Yield on cost — the dividend metric DRIP quietly builds</title>
      <dc:creator>a353551071</dc:creator>
      <pubDate>Sun, 16 Aug 2026 14:01:59 +0000</pubDate>
      <link>https://dev.to/a353551071/yield-on-cost-the-dividend-metric-drip-quietly-builds-pgm</link>
      <guid>https://dev.to/a353551071/yield-on-cost-the-dividend-metric-drip-quietly-builds-pgm</guid>
      <description>&lt;p&gt;Everybody quotes &lt;strong&gt;current yield&lt;/strong&gt; — annual dividend ÷ today's price. It's the headline number. It's also the wrong number to watch once you actually own a position and reinvest. The number reinvestment grows is &lt;strong&gt;yield on cost&lt;/strong&gt;: annual dividend ÷ what you originally paid.&lt;/p&gt;

&lt;p&gt;A &lt;a href="https://www.dividendpayoutcalculator.com/calculators/drip-calculator" rel="noopener noreferrer"&gt;DRIP calculator&lt;/a&gt; makes this visible in a way a brokerage statement doesn't. The engine is the same open-source library, &lt;strong&gt;&lt;a href="https://github.com/a353551071/dividend-math" rel="noopener noreferrer"&gt;dividend-math&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What reinvestment actually does
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;dripCalculator&lt;/code&gt; simulates a dividend reinvestment plan year by year: dividends computed at the current yield on the current share count, reinvested into more shares at the current price, with both price and dividend growing each year.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;dripCalculator&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dividend-math&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;dripCalculator&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;initialInvestment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;dividendYieldPct&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;3.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;dividendGrowthPct&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;priceGrowthPct&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;monthlyContribution&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;years&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// The number nobody quotes: yield on cost&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;yieldOnCost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;finalAnnualDividendIncome&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;totalInvested&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The interesting move is that last line. &lt;code&gt;totalInvested&lt;/code&gt; is what you actually put in (initial + contributions). &lt;code&gt;finalAnnualDividendIncome&lt;/code&gt; is what the position throws off per year at the end. Divide them and you get the yield on your &lt;em&gt;original&lt;/em&gt; dollars — and after 15–20 years of dividend growth plus reinvestment, that number regularly runs two to three times the starting yield.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it climbs
&lt;/h2&gt;

&lt;p&gt;Two forces, both quiet:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The dividend grows.&lt;/strong&gt; A 3.5% payer raising its dividend ~10%/yr nearly triples the per-share dividend in a decade.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reinvestment buys more shares&lt;/strong&gt; at prevailing prices, and those shares then pay the (growing) dividend too.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Current yield can stay flat the whole time — the price rises alongside the dividend — while yield on cost keeps climbing, because the denominator is your &lt;em&gt;historical&lt;/em&gt; cost, not today's price. That's the real return a long-term DRIP creates, and it's invisible if you only look at current yield.&lt;/p&gt;

&lt;h2&gt;
  
  
  The edge case worth getting right
&lt;/h2&gt;

&lt;p&gt;Cumulative dividends over N years are a geometric series: &lt;code&gt;D + D(1+g) + D(1+g)² + …&lt;/code&gt;. When &lt;code&gt;g = 0&lt;/code&gt; it collapses to &lt;code&gt;D × N&lt;/code&gt;; when &lt;code&gt;g &amp;gt; 0&lt;/code&gt; it's the closed-form &lt;code&gt;(D·((1+g)ᴺ−1))/g&lt;/code&gt;. The &lt;code&gt;g = 0&lt;/code&gt; branch has to be handled separately — divide by zero otherwise. It's the kind of thing that's easy to get subtly wrong, which is why every formula in the library is a pure function covered by &lt;a href="https://github.com/a353551071/dividend-math/blob/main/tests/dividend.test.ts" rel="noopener noreferrer"&gt;unit tests&lt;/a&gt;. Same &lt;code&gt;dripCalculator&lt;/code&gt; drives the DRIP, SCHD, &lt;a href="https://www.dividendpayoutcalculator.com/calculators/qqqi-dividend-calculator" rel="noopener noreferrer"&gt;QQQI&lt;/a&gt;, and monthly pages on &lt;a href="https://www.dividendpayoutcalculator.com" rel="noopener noreferrer"&gt;dividendpayoutcalculator.com&lt;/a&gt; — one implementation, no drift.&lt;/p&gt;

&lt;h2&gt;
  
  
  Run it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Live DRIP / &lt;a href="https://www.dividendpayoutcalculator.com/calculators/drip-calculator" rel="noopener noreferrer"&gt;dividend reinvestment calculator&lt;/a&gt;:&lt;/strong&gt; year-by-year table + chart, no sign-up.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Library (npm):&lt;/strong&gt; &lt;code&gt;npm install dividend-math&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; &lt;a href="https://github.com/a353551071/dividend-math" rel="noopener noreferrer"&gt;github.com/a353551071/dividend-math&lt;/a&gt; (MIT)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Math/engineering post, not financial advice. Past dividend growth doesn't guarantee future growth; model scenarios, don't pick tickers.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;How do you track yield on cost in your own portfolio — spreadsheet column, or do you let the broker's cost basis do the work? Always felt like a metric more people should watch.&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>finance</category>
      <category>math</category>
      <category>opensource</category>
    </item>
    <item>
      <title>The math of a monthly dividend ETF (QQQI), in TypeScript</title>
      <dc:creator>a353551071</dc:creator>
      <pubDate>Tue, 11 Aug 2026 14:14:01 +0000</pubDate>
      <link>https://dev.to/a353551071/the-math-of-a-monthly-dividend-etf-qqqi-in-typescript-42h0</link>
      <guid>https://dev.to/a353551071/the-math-of-a-monthly-dividend-etf-qqqi-in-typescript-42h0</guid>
      <description>&lt;p&gt;Most dividend ETFs pay quarterly. &lt;a href="https://www.dividendpayoutcalculator.com/calculators/qqqi-dividend-calculator" rel="noopener noreferrer"&gt;QQQI&lt;/a&gt; pays &lt;strong&gt;monthly&lt;/strong&gt;, and at a yield up in the low-double digits — it's a covered-call fund, so a chunk of that distribution comes from option premiums, not pure dividends. That combination — monthly cadence, high yield, options-derived income — makes the math interesting in a very different way than a plain growth payer like &lt;a href="https://www.dividendpayoutcalculator.com/calculators/schd-dividend-calculator" rel="noopener noreferrer"&gt;SCHD&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I built a dedicated QQQI calculator to make the tradeoffs visible, powered by the same open-source library: &lt;strong&gt;&lt;a href="https://github.com/a353551071/dividend-math" rel="noopener noreferrer"&gt;dividend-math&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why "monthly" changes the compounding
&lt;/h2&gt;

&lt;p&gt;Reinvestment frequency matters. The more often you reinvest, the sooner each reinvested cent starts earning. A monthly payer gives you 12 reinvestment points a year instead of 4. Same annual rate, more frequent compounding — the gap is small in year one and meaningful over a decade.&lt;/p&gt;

&lt;p&gt;The monthly-income side is a single pure function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;monthlyDividendIncome&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dividend-math&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// $50,000 in a ~13% monthly payer&lt;/span&gt;
&lt;span class="nf"&gt;monthlyDividendIncome&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;investment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;50000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;dividendYieldPct&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;13&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt; &lt;span class="c1"&gt;// → ~541.67/month&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the longer horizon uses &lt;code&gt;dripCalculator&lt;/code&gt;, which reinvests year by year:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;dripCalculator&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dividend-math&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;dripCalculator&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;initialInvestment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;50000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;dividendYieldPct&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;dividendGrowthPct&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;// high option-yield funds don't *grow* the dividend much&lt;/span&gt;
  &lt;span class="na"&gt;priceGrowthPct&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;      &lt;span class="c1"&gt;// …and price upside is capped by the call side&lt;/span&gt;
  &lt;span class="na"&gt;monthlyContribution&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;years&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&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;Notice the inputs that tell the real story: a high yield paired with &lt;strong&gt;low growth&lt;/strong&gt;. That's the structural difference between an options-income fund and a dividend-growth fund.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part the yield number hides
&lt;/h2&gt;

&lt;p&gt;A 13% monthly yield is a great headline. But for a covered-call fund, two things drag on it: the dividend barely grows (you're selling upside for income), and the net asset value can erode if the option strategy underperforms in strong rallies. So the "monthly income" looks lush while the principal may not compound the way a growth payer's does.&lt;/p&gt;

&lt;p&gt;This is exactly why the &lt;a href="https://www.dividendpayoutcalculator.com/calculators/qqqi-dividend-calculator" rel="noopener noreferrer"&gt;QQQI calculator&lt;/a&gt; on &lt;a href="https://www.dividendpayoutcalculator.com" rel="noopener noreferrer"&gt;dividendpayoutcalculator.com&lt;/a&gt; shows the income &lt;strong&gt;and&lt;/strong&gt; the projected value side by side — so you can't fall in love with the monthly number without seeing what's happening to the base.&lt;/p&gt;

&lt;p&gt;The honest framing: a monthly payer is an income tool, not a compounding engine. Different job than SCHD. The math makes that obvious once you model both.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pure functions, one library
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;monthlyDividendIncome&lt;/code&gt;, &lt;code&gt;dripCalculator&lt;/code&gt;, &lt;code&gt;dividendYield&lt;/code&gt;, &lt;code&gt;payoutRatio&lt;/code&gt; — all pure functions, all edge-tested (&lt;a href="https://github.com/a353551071/dividend-math/blob/main/tests/dividend.test.ts" rel="noopener noreferrer"&gt;unit tests&lt;/a&gt;). One library drives every calculator page on the site, so the monthly income on the QQQI page is the same formula as anywhere else.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Live QQQI calculator:&lt;/strong&gt; &lt;a href="https://www.dividendpayoutcalculator.com/calculators/qqqi-dividend-calculator" rel="noopener noreferrer"&gt;dividendpayoutcalculator.com/.../qqqi-dividend-calculator&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Library (npm):&lt;/strong&gt; &lt;code&gt;npm install dividend-math&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; &lt;a href="https://github.com/a353551071/dividend-math" rel="noopener noreferrer"&gt;github.com/a353551071/dividend-math&lt;/a&gt; (MIT)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Engineering + math post, not financial advice. Option-income funds have real NAV and tax complexities — model scenarios, don't pick tickers from a blog.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;For the high-yield folks: how do you model the NAV-erosion drag in a reinvestment sim — flat haircut on the yield, or a price-growth assumption below the index? Genuinely curious what's worked in your models.&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>finance</category>
      <category>opensource</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Modeling SCHD's dividend growth, in TypeScript</title>
      <dc:creator>a353551071</dc:creator>
      <pubDate>Sun, 09 Aug 2026 11:43:11 +0000</pubDate>
      <link>https://dev.to/a353551071/modeling-schds-dividend-growth-in-typescript-1lom</link>
      <guid>https://dev.to/a353551071/modeling-schds-dividend-growth-in-typescript-1lom</guid>
      <description>&lt;p&gt;SCHD (Schwab's U.S. Dividend Equity ETF) shows up on every "best dividend ETF" list, but rarely for the reason that actually matters: &lt;strong&gt;its dividend grows&lt;/strong&gt;. The starting yield is modest — somewhere in the 3–4% neighborhood — yet SCHD has raised its dividend on the order of ~10–12% per year over its life. That's the whole game. A flat 6% yield pinned to a share count that never moves eventually gets lapped by a 3.5% yield that grows and compounds.&lt;/p&gt;

&lt;p&gt;I wanted to make that math tangible, so I built a dedicated &lt;a href="https://www.dividendpayoutcalculator.com/calculators/schd-dividend-calculator" rel="noopener noreferrer"&gt;SCHD dividend calculator&lt;/a&gt; — and the engine behind it is the same tiny TypeScript library I open-sourced: &lt;strong&gt;&lt;a href="https://github.com/a353551071/dividend-math" rel="noopener noreferrer"&gt;dividend-math&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The model
&lt;/h2&gt;

&lt;p&gt;The core is one pure function, &lt;code&gt;dripCalculator&lt;/code&gt;, that simulates year by year:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Dividends at the &lt;strong&gt;current&lt;/strong&gt; yield on the &lt;strong&gt;current&lt;/strong&gt; share count.&lt;/li&gt;
&lt;li&gt;Reinvest those dividends into more shares at the &lt;strong&gt;current&lt;/strong&gt; price.&lt;/li&gt;
&lt;li&gt;Grow the price by &lt;code&gt;priceGrowthPct&lt;/code&gt;, and — the part that matters for SCHD — grow the &lt;strong&gt;dividend&lt;/strong&gt; itself by &lt;code&gt;dividendGrowthPct&lt;/code&gt;.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;dripCalculator&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dividend-math&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// A SCHD-shaped scenario: modest starting yield, meaningful annual dividend growth&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;dripCalculator&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;initialInvestment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;dividendYieldPct&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;3.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;dividendGrowthPct&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;// SCHD's dividend has grown ~10-12%/yr historically&lt;/span&gt;
  &lt;span class="na"&gt;priceGrowthPct&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;monthlyContribution&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;years&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="c1"&gt;// → { shares, finalPrice, finalValue, totalInvested, totalDividends, finalAnnualDividendIncome }&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The numbers above are illustrative — a SCHD-shaped profile, not a forecast. SCHD pays quarterly, and the live calculator handles the quarterly cadence and lets you plug in real figures. The point of the model is the &lt;em&gt;shape&lt;/em&gt;, not the decimals.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why growth beats a fat yield
&lt;/h2&gt;

&lt;p&gt;The result that surprises people: after 15 years the &lt;strong&gt;annual dividend income&lt;/strong&gt; on that position is several multiples of year one — not because the yield is high, but because the dividend grew ~11% a year and every reinvestment bought shares that then threw off more dividend.&lt;/p&gt;

&lt;p&gt;This is why a "good" yield for a holding you intend to keep is usually 3–5%, not 8%+. A yield that high often means the price collapsed (yield = dividend ÷ price, so a crashing price &lt;em&gt;inflates&lt;/em&gt; the yield) or the payout is unsustainable. SCHD's appeal is the opposite: a moderate, &lt;em&gt;growing&lt;/em&gt; dividend funded by real earnings.&lt;/p&gt;

&lt;p&gt;That's also why the &lt;a href="https://www.dividendpayoutcalculator.com/calculators/schd-dividend-calculator" rel="noopener noreferrer"&gt;calculator&lt;/a&gt; pairs yield with the payout ratio — a high yield you can't trust is worse than a lower one you can.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pure functions, one source of truth
&lt;/h2&gt;

&lt;p&gt;Every formula is a pure function — &lt;code&gt;dividendYield&lt;/code&gt;, &lt;code&gt;payoutRatio&lt;/code&gt;, &lt;code&gt;dripCalculator&lt;/code&gt; — so the edge cases (zero price, zero growth, the geometric-series term when growth is zero) are pinned down by &lt;a href="https://github.com/a353551071/dividend-math/blob/main/tests/dividend.test.ts" rel="noopener noreferrer"&gt;unit tests&lt;/a&gt;. The same &lt;code&gt;dripCalculator&lt;/code&gt; drives the DRIP page, the SCHD and &lt;a href="https://www.dividendpayoutcalculator.com/calculators/qqqi-dividend-calculator" rel="noopener noreferrer"&gt;QQQI&lt;/a&gt; ETF calculators, and the monthly-income page on &lt;a href="https://www.dividendpayoutcalculator.com" rel="noopener noreferrer"&gt;dividendpayoutcalculator.com&lt;/a&gt;. One implementation, no drift between pages.&lt;/p&gt;

&lt;h2&gt;
  
  
  Run it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Live SCHD calculator:&lt;/strong&gt; &lt;a href="https://www.dividendpayoutcalculator.com/calculators/schd-dividend-calculator" rel="noopener noreferrer"&gt;dividendpayoutcalculator.com/.../schd-dividend-calculator&lt;/a&gt; — real quarterly cadence, no sign-up.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Library (npm):&lt;/strong&gt; &lt;code&gt;npm install dividend-math&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; &lt;a href="https://github.com/a353551071/dividend-math" rel="noopener noreferrer"&gt;github.com/a353551071/dividend-math&lt;/a&gt; (MIT)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;This is a math/engineering post, not financial advice. Dividends aren't guaranteed and past growth doesn't predict future results — use the calculator to model scenarios, not to pick tickers.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Anything you'd add to the model — tax drag, yield-on-cost tracking, variable contribution timing? Curious how you'd extend it.&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>finance</category>
      <category>opensource</category>
      <category>showdev</category>
    </item>
    <item>
      <title>I open-sourced the math behind my dividend calculator</title>
      <dc:creator>a353551071</dc:creator>
      <pubDate>Sat, 08 Aug 2026 11:57:05 +0000</pubDate>
      <link>https://dev.to/a353551071/i-open-sourced-the-math-behind-my-dividend-calculator-2in7</link>
      <guid>https://dev.to/a353551071/i-open-sourced-the-math-behind-my-dividend-calculator-2in7</guid>
      <description>&lt;p&gt;When I built a free &lt;a href="https://www.dividendpayoutcalculator.com" rel="noopener noreferrer"&gt;dividend payout calculator&lt;/a&gt;, the interesting part wasn't the UI — it was the math. Dividend yield, payout ratio, and especially the way a DRIP (dividend reinvestment plan) compounds year over year. So I pulled the formulas out into a tiny, zero-dependency TypeScript library: &lt;strong&gt;&lt;a href="https://github.com/a353551071/dividend-math" rel="noopener noreferrer"&gt;dividend-math&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This post is the story of the library and the one calculation that surprised me: how reinvestment plus growth quietly outruns a flat high yield.&lt;/p&gt;

&lt;h2&gt;
  
  
  The library
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;dividend-math&lt;/code&gt; is one file of pure functions. No runtime dependencies, no I/O, fully tree-shakeable. You can &lt;code&gt;npm install dividend-math&lt;/code&gt; or just copy &lt;a href="https://github.com/a353551071/dividend-math/blob/main/src/dividend.ts" rel="noopener noreferrer"&gt;&lt;code&gt;src/dividend.ts&lt;/code&gt;&lt;/a&gt; into your project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;dividendYield&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;payoutRatio&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;monthlyDividendIncome&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;dripCalculator&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dividend-math&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Yield: $2.80 annual dividend on an $80 share&lt;/span&gt;
&lt;span class="nf"&gt;dividendYield&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;annualDividendPerShare&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;2.8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt; &lt;span class="c1"&gt;// → 3.5 (%)&lt;/span&gt;

&lt;span class="c1"&gt;// Sustainability: dividend vs earnings&lt;/span&gt;
&lt;span class="nf"&gt;payoutRatio&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;dividendPerShare&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;earningsPerShare&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt; &lt;span class="c1"&gt;// → 40 (%)&lt;/span&gt;

&lt;span class="c1"&gt;// Monthly cash flow on a position&lt;/span&gt;
&lt;span class="nf"&gt;monthlyDividendIncome&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;investment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;50000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;dividendYieldPct&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;13&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt; &lt;span class="c1"&gt;// → ~541.67/month&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All percentage inputs are plain numbers (&lt;code&gt;5&lt;/code&gt; for 5%); money is in dollars. Returns are numeric and predictable — &lt;code&gt;dividendYield&lt;/code&gt; returns &lt;code&gt;NaN&lt;/code&gt; for a zero price, &lt;code&gt;payoutRatio&lt;/code&gt; returns &lt;code&gt;NaN&lt;/code&gt; for zero earnings, so the bad inputs fail loudly instead of producing pretty-looking nonsense.&lt;/p&gt;

&lt;h2&gt;
  
  
  The interesting one: DRIP compounding
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;dripCalculator&lt;/code&gt; simulates a dividend reinvestment plan year by year. Each year it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Computes dividends at the &lt;strong&gt;current&lt;/strong&gt; yield on the &lt;strong&gt;current&lt;/strong&gt; share count.&lt;/li&gt;
&lt;li&gt;Reinvests those dividends into more shares at the &lt;strong&gt;current&lt;/strong&gt; price.&lt;/li&gt;
&lt;li&gt;Adds monthly contributions buying shares at the current price.&lt;/li&gt;
&lt;li&gt;Then grows the price by &lt;code&gt;priceGrowthPct&lt;/code&gt; and the yield by &lt;code&gt;dividendGrowthPct&lt;/code&gt;.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;dripCalculator&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;initialInvestment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;dividendYieldPct&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;3.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;dividendGrowthPct&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;priceGrowthPct&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;monthlyContribution&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;years&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="c1"&gt;// → { shares, finalPrice, finalValue, totalInvested, totalDividends, finalAnnualDividendIncome }&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result that always gets people: &lt;strong&gt;a 3.5% yield with 10% annual dividend growth, reinvested, beats a flat 6% yield over a long horizon&lt;/strong&gt; — because the dividend grows &lt;em&gt;and&lt;/em&gt; buys more shares as it does. The starting yield is the wrong number to optimize; the growth rate matters more.&lt;/p&gt;

&lt;p&gt;That's the whole reason a "good" dividend yield is usually 3–5%, not 8%+. A high yield often means the price collapsed or the payout is unsustainable — which is why the calculator pairs yield with the payout ratio.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why pure functions, and why a library at all?
&lt;/h2&gt;

&lt;p&gt;Two reasons. First, &lt;strong&gt;testability&lt;/strong&gt;: every formula is a pure function, so the edge cases (zero price, zero growth, g = 0 in the geometric series for cumulative dividends) are covered by &lt;a href="https://github.com/a353551071/dividend-math/blob/main/tests/dividend.test.ts" rel="noopener noreferrer"&gt;16 unit tests&lt;/a&gt;. Second, &lt;strong&gt;reuse&lt;/strong&gt;: the same &lt;code&gt;dripCalculator&lt;/code&gt; drives the DRIP page, the SCHD and QQQI ETF calculators, and the monthly-income page on the live site. One source of truth, no drift.&lt;/p&gt;

&lt;h2&gt;
  
  
  The live calculator
&lt;/h2&gt;

&lt;p&gt;The library powers &lt;a href="https://www.dividendpayoutcalculator.com" rel="noopener noreferrer"&gt;dividendpayoutcalculator.com&lt;/a&gt; — a free suite with dedicated calculators for &lt;a href="https://www.dividendpayoutcalculator.com/calculators/schd-dividend-calculator" rel="noopener noreferrer"&gt;SCHD&lt;/a&gt; and &lt;a href="https://www.dividendpayoutcalculator.com/calculators/qqqi-dividend-calculator" rel="noopener noreferrer"&gt;QQQI&lt;/a&gt;, plus yield, payout ratio, growth, and monthly income. No sign-up, runs entirely in the browser.&lt;/p&gt;

&lt;p&gt;If you're building anything finance-adjacent and need the math, grab the library. If you just want to run the numbers, the calculator's free.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Library (npm):&lt;/strong&gt; &lt;code&gt;npm install dividend-math&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; &lt;a href="https://github.com/a353551071/dividend-math" rel="noopener noreferrer"&gt;github.com/a353551071/dividend-math&lt;/a&gt; (MIT)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live app:&lt;/strong&gt; &lt;a href="https://www.dividendpayoutcalculator.com" rel="noopener noreferrer"&gt;dividendpayoutcalculator.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thoughts on the DRIP model — anything you'd add to the simulation (tax drag, FX, variable monthly contributions)? I'd love to hear how you'd extend it.&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>finance</category>
      <category>opensource</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
