<?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: Kai</title>
    <description>The latest articles on DEV Community by Kai (@fundingkai).</description>
    <link>https://dev.to/fundingkai</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%2F3914002%2F0f66d82d-9438-46f6-9abc-367d88e06bda.png</url>
      <title>DEV Community: Kai</title>
      <link>https://dev.to/fundingkai</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fundingkai"/>
    <language>en</language>
    <item>
      <title>Building a Crypto Funding Rate Data Pipeline with Python</title>
      <dc:creator>Kai</dc:creator>
      <pubDate>Sun, 17 May 2026 21:08:53 +0000</pubDate>
      <link>https://dev.to/fundingkai/building-a-crypto-funding-rate-data-pipeline-with-python-2go4</link>
      <guid>https://dev.to/fundingkai/building-a-crypto-funding-rate-data-pipeline-with-python-2go4</guid>
      <description>&lt;p&gt;I needed funding rate data across multiple exchanges in a single place. Nothing free gave me what I wanted: historical rates, cross-exchange comparisons, and annualised calculations. So I built it.&lt;/p&gt;

&lt;p&gt;Here's how the data pipeline works, and what I learned along the way.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Architecture
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Exchange APIs (Bybit, Binance)
        |
    Scheduled collector (every 8h)
        |
    PostgreSQL + TimescaleDB
        |
    JSON snapshot generator (3x/day)
        |
    Static site (Astro on Cloudflare Pages)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The key design decision: &lt;strong&gt;don't serve live API queries to the frontend&lt;/strong&gt;. Instead, generate JSON snapshots on a schedule and serve them as static files. This gives you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Zero backend load from page views&lt;/li&gt;
&lt;li&gt;Free hosting on Cloudflare Pages&lt;/li&gt;
&lt;li&gt;Sub-50ms page loads globally&lt;/li&gt;
&lt;li&gt;No API rate limits to worry about&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Collecting the Data
&lt;/h2&gt;

&lt;p&gt;Both Bybit and Binance expose funding rate history via their public REST APIs. No authentication required for reading rates.&lt;/p&gt;

&lt;p&gt;The collector runs on a schedule, pulls the latest rates for each asset, and writes them to TimescaleDB (PostgreSQL with time-series extensions). Each row stores:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Asset (BTC, ETH, SOL, etc.)&lt;/li&gt;
&lt;li&gt;Exchange&lt;/li&gt;
&lt;li&gt;Funding rate (raw 8h)&lt;/li&gt;
&lt;li&gt;Annualised rate&lt;/li&gt;
&lt;li&gt;Timestamp&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Annualising Rates
&lt;/h2&gt;

&lt;p&gt;This is where most tools get it wrong. A raw funding rate of 0.01% per 8h doesn't mean 0.03% per day. Funding compounds:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;annualised&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;rate_8h&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="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;365&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;3 * 365&lt;/code&gt; comes from 3 settlements per day, 365 days per year. At 0.01% per 8h, that's ~11.6% annualised, not 10.95% (which is what simple multiplication gives you).&lt;/p&gt;

&lt;p&gt;The difference matters when you're comparing a 0.03% rate against a 0.05% rate. Simple multiplication says the spread is 0.02%. Compound calculation says it's larger.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Snapshot Generator
&lt;/h2&gt;

&lt;p&gt;Every 8 hours, a scheduled job:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Queries the latest rates from the database&lt;/li&gt;
&lt;li&gt;Calculates cross-exchange spreads&lt;/li&gt;
&lt;li&gt;Generates JSON files per asset&lt;/li&gt;
&lt;li&gt;Triggers a site rebuild on Cloudflare Pages&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The static site reads these JSON files at build time using Astro's data layer. No runtime database queries.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd Do Differently
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Start with TimescaleDB from day one.&lt;/strong&gt; I initially used plain PostgreSQL and migrated later. Time-series queries (rolling averages, period comparisons) are dramatically faster with hypertables.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Collect more frequently than you display.&lt;/strong&gt; I collect every 8h but could go hourly. Having higher-resolution data lets you spot intraday patterns even if you only show 8h snapshots publicly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add WebSocket for liquidation data early.&lt;/strong&gt; REST polling works for funding rates (they only change every 8h). Liquidation events are real-time — you need a persistent WebSocket connection.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Result
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://fundingkai.com" rel="noopener noreferrer"&gt;FundingKai&lt;/a&gt; tracks 10 major assets across exchanges. The data pipeline runs autonomously — no manual intervention since launch.&lt;/p&gt;

&lt;p&gt;If you're building something similar, the key insight is: &lt;strong&gt;separate collection from presentation&lt;/strong&gt;. Collect into a proper database, serve via static snapshots. Your data pipeline and your frontend have completely different reliability and performance requirements.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;The data is live at &lt;a href="https://fundingkai.com" rel="noopener noreferrer"&gt;fundingkai.com&lt;/a&gt;. Built with Python, PostgreSQL/TimescaleDB, Astro, and Cloudflare Pages.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>crypto</category>
      <category>webdev</category>
      <category>data</category>
    </item>
    <item>
      <title>What Crypto Funding Rates Actually Tell You (With Real Data)</title>
      <dc:creator>Kai</dc:creator>
      <pubDate>Sun, 17 May 2026 20:57:09 +0000</pubDate>
      <link>https://dev.to/fundingkai/what-crypto-funding-rates-actually-tell-you-with-real-data-4fk7</link>
      <guid>https://dev.to/fundingkai/what-crypto-funding-rates-actually-tell-you-with-real-data-4fk7</guid>
      <description>&lt;p&gt;Funding rates are the most underused signal in crypto. Every 8 hours, perpetual futures exchanges settle a payment between longs and shorts. When the rate is positive, longs pay shorts. When negative, shorts pay longs.&lt;/p&gt;

&lt;p&gt;Simple concept, but the implications are significant.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Funding Rates Matter
&lt;/h2&gt;

&lt;p&gt;Funding rates reflect &lt;strong&gt;real money flowing between positions&lt;/strong&gt;. Unlike technical indicators derived from price, funding rates show you what traders are actually paying to hold their positions.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;High positive rates&lt;/strong&gt; (&amp;gt;0.03% per 8h / &amp;gt;40% annualised): Market is crowded long. Longs are paying a premium to hold. Historically, this precedes corrections.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deeply negative rates&lt;/strong&gt; (&amp;lt;-0.01%): Shorts are dominant and paying to stay short. Often seen at local bottoms.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Near zero&lt;/strong&gt;: Market is balanced. No strong directional bias from leveraged traders.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Cross-Exchange Spreads Are the Real Signal
&lt;/h2&gt;

&lt;p&gt;A funding rate on one exchange is interesting. The &lt;strong&gt;spread between exchanges&lt;/strong&gt; is where the edge lives.&lt;/p&gt;

&lt;p&gt;When Bybit shows +0.05% and another venue shows +0.01% on the same asset, it tells you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Leverage concentration differs between venues&lt;/li&gt;
&lt;li&gt;Arbitrageurs haven't fully equalised the imbalance&lt;/li&gt;
&lt;li&gt;There may be a carry trade opportunity (short the expensive venue, long the cheap one)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What the Data Shows Right Now
&lt;/h2&gt;

&lt;p&gt;I built &lt;a href="https://fundingkai.com" rel="noopener noreferrer"&gt;FundingKai&lt;/a&gt; to track funding rates across exchanges for 10 major assets. The data refreshes three times daily from live exchange APIs.&lt;/p&gt;

&lt;p&gt;Some patterns I've observed from running this data pipeline:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;BTC funding tends to lead altcoin funding&lt;/strong&gt; by 2-4 hours during momentum shifts&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross-exchange spreads widen during volatility&lt;/strong&gt; — settlement edges become more pronounced&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Weekend funding rates compress&lt;/strong&gt; as institutional desks reduce exposure&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  How to Read the Data
&lt;/h2&gt;

&lt;p&gt;If you want to start monitoring funding rates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Track the &lt;strong&gt;annualised rate&lt;/strong&gt;, not the raw 8h number. A 0.01% rate looks tiny but compounds to ~13% annually.&lt;/li&gt;
&lt;li&gt;Watch for &lt;strong&gt;rate inversions&lt;/strong&gt; — when a usually-positive asset flips negative (or vice versa), something is changing.&lt;/li&gt;
&lt;li&gt;Compare &lt;strong&gt;at least two exchanges&lt;/strong&gt; to distinguish venue-specific noise from genuine market sentiment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The raw data for 10 assets across multiple exchanges is available at &lt;a href="https://fundingkai.com/rates/bitcoin" rel="noopener noreferrer"&gt;fundingkai.com/rates&lt;/a&gt;. Updated three times daily.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I'm building FundingKai as an open data project for crypto funding rate analysis. No trading advice, no performance claims — just data and the patterns in it.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>crypto</category>
      <category>trading</category>
      <category>data</category>
      <category>defi</category>
    </item>
  </channel>
</rss>
