<?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: Matt</title>
    <description>The latest articles on DEV Community by Matt (@mattpegcheck).</description>
    <link>https://dev.to/mattpegcheck</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3906454%2Fafae94ab-e3e0-4e33-a603-3065fab19c3b.jpg</url>
      <title>DEV Community: Matt</title>
      <link>https://dev.to/mattpegcheck</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mattpegcheck"/>
    <language>en</language>
    <item>
      <title>How I built a stablecoin depeg monitoring API with Chainlink — median of medians across 1,500+ data points</title>
      <dc:creator>Matt</dc:creator>
      <pubDate>Thu, 30 Apr 2026 16:34:36 +0000</pubDate>
      <link>https://dev.to/mattpegcheck/how-i-built-a-stablecoin-depeg-monitoring-api-with-chainlink-median-of-medians-across-1500-data-1m7f</link>
      <guid>https://dev.to/mattpegcheck/how-i-built-a-stablecoin-depeg-monitoring-api-with-chainlink-median-of-medians-across-1500-data-1m7f</guid>
      <description>&lt;p&gt;The Problem&lt;br&gt;
Stablecoin depegs cause billions in losses. In 2022 TerraUSD collapsed overnight, wiping out billions in savings. Most people had no idea it was happening until it was too late.&lt;br&gt;
The existing monitoring tools have a fundamental flaw — they rely on a single price source. One source can be wrong, manipulated, or just slow.&lt;br&gt;
The Solution — Median of Medians&lt;br&gt;
I built PegCheck, a stablecoin depeg monitoring API that aggregates from 6 independent sources:&lt;br&gt;
CoinGecko&lt;br&gt;
Coinbase&lt;br&gt;
Binance&lt;br&gt;
Kraken&lt;br&gt;
DefiLlama&lt;br&gt;
Chainlink price feeds&lt;br&gt;
Then calculates a median across all of them — producing a single manipulation-resistant consensus price across 1,500+ data points.&lt;br&gt;
The Chainlink Integration&lt;br&gt;
Adding Chainlink took PegCheck to another level:&lt;br&gt;
Price Feeds — USDT, USDC, USDS and TUSD price feeds on Ethereum Mainnet, added as a verified on-chain source to the median calculation.&lt;br&gt;
Proof of Reserve — Chainlink PoR data for TUSD, giving verified on-chain reserve verification directly in the API response.&lt;br&gt;
On-chain depeg logging — Every depeg event is permanently logged to an Ethereum smart contract. Immutable, public, verifiable by anyone at pegcheck.uk/onchain.&lt;br&gt;
The API&lt;br&gt;
Five clean REST endpoints.&lt;/p&gt;

&lt;p&gt;GET /api/v1/coins&lt;br&gt;
GET /api/v1/coins/{slug}&lt;br&gt;
GET /api/v1/coins/{slug}/history&lt;br&gt;
GET /api/v1/alerts/status&lt;br&gt;
POST /api/v1/webhooks/register&lt;/p&gt;

&lt;p&gt;Bearer token auth, three pricing tiers, Stripe payments, auto key generation, customer dashboard.&lt;br&gt;
Quick Example&lt;/p&gt;

&lt;p&gt;Javascript&lt;br&gt;
fetch("&lt;a href="https://pegcheck.uk/api/v1/coins" rel="noopener noreferrer"&gt;https://pegcheck.uk/api/v1/coins&lt;/a&gt;", {&lt;br&gt;
  headers: { "Authorization": "Bearer YOUR_KEY" }&lt;br&gt;
})&lt;br&gt;
.then(r =&amp;gt; r.json())&lt;br&gt;
.then(data =&amp;gt; console.log(data))&lt;/p&gt;

&lt;p&gt;Returns:&lt;br&gt;
Json&lt;br&gt;
{&lt;br&gt;
  "slug": "usdt",&lt;br&gt;
  "price": 0.9998,&lt;br&gt;
  "status": "stable",&lt;br&gt;
  "deviation": -0.02,&lt;br&gt;
  "chainlink_por": {&lt;br&gt;
    "reserves": 50192890088,&lt;br&gt;
    "updated_at": "2026-04-30T12:00:00Z"&lt;br&gt;
  }&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Try It Free&lt;br&gt;
30 day free trial, no credit card needed.&lt;br&gt;
👉 pegcheck.uk/developers&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>chainlink</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
