<?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>Forem: Koushik Ghosh</title>
    <description>The latest articles on Forem by Koushik Ghosh (@koushik_ai).</description>
    <link>https://forem.com/koushik_ai</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%2F3849700%2F3f2eb321-b5ab-4858-b70e-3310b2edf2ab.jpg</url>
      <title>Forem: Koushik Ghosh</title>
      <link>https://forem.com/koushik_ai</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/koushik_ai"/>
    <language>en</language>
    <item>
      <title>Building Oracle Gym - A Gamified Crypto Trading Arena with Pyth Network</title>
      <dc:creator>Koushik Ghosh</dc:creator>
      <pubDate>Mon, 30 Mar 2026 07:31:22 +0000</pubDate>
      <link>https://forem.com/koushik_ai/building-oracle-gym-a-gamified-crypto-trading-arena-with-pyth-network-37c5</link>
      <guid>https://forem.com/koushik_ai/building-oracle-gym-a-gamified-crypto-trading-arena-with-pyth-network-37c5</guid>
      <description>&lt;p&gt;Ever wondered if you'd survive a crypto flash crash? What if you could practice trading with &lt;strong&gt;real market data&lt;/strong&gt; without risking actual money?&lt;/p&gt;

&lt;p&gt;That's why I built &lt;strong&gt;Oracle Gym&lt;/strong&gt; - a gamified trading platform powered by Pyth Network that lets you replay actual market conditions.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Most paper trading platforms use &lt;strong&gt;fake data&lt;/strong&gt;. When you practice on simulated prices, you're not learning how real markets behave.&lt;/p&gt;

&lt;p&gt;Oracle Gym solves this by using &lt;strong&gt;real Pyth Network price feeds&lt;/strong&gt; to create authentic training scenarios.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Oracle Gym?
&lt;/h2&gt;

&lt;p&gt;Oracle Gym is a gamified crypto trading trainer where you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Replay real markets&lt;/strong&gt; - Choose from 13 crypto assets with actual Pyth price data&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Face random shocks&lt;/strong&gt; - Powered by Pyth Entropy V2 smart contract
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Make decisions&lt;/strong&gt; - Buy, sell, hold, reduce, wait, or hedge at checkpoints&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Get scored&lt;/strong&gt; - AI coaching analyzes your performance&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Level up&lt;/strong&gt; - Earn XP, build streaks, compete on leaderboards&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Think of it as a &lt;em&gt;flight simulator for crypto traders&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tech Stack
&lt;/h2&gt;

&lt;p&gt;Built with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Frontend&lt;/strong&gt;: Next.js 15, TypeScript, Tailwind CSS v4&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Blockchain&lt;/strong&gt;: Wagmi v3, Viem v2, Base Sepolia&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pyth&lt;/strong&gt;: Hermes API (real-time + historical), Entropy V2 (on-chain randomness)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wallets&lt;/strong&gt;: 300+ supported (MetaMask, WalletConnect, Coinbase Wallet)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Price Feed Integration
&lt;/h3&gt;

&lt;p&gt;Oracle Gym uses Pyth's Hermes API for real-time and historical price data. Each feed includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;price&lt;/code&gt; - The actual price value&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;expo&lt;/code&gt; - Exponent for decimal handling
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;publish_time&lt;/code&gt; - Timestamp verification&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;conf&lt;/code&gt; - Confidence intervals&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Entropy V2 for Random Shocks
&lt;/h3&gt;

&lt;p&gt;The "boss fight" feature uses Pyth Entropy V2 to generate &lt;strong&gt;verifiable on-chain randomness&lt;/strong&gt;. This creates unpredictable market shocks that are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Unpredictable&lt;/em&gt; - No one can predict the outcome&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Verifiable&lt;/em&gt; - Anyone can verify on-chain
&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Fair&lt;/em&gt; - Cannot be manipulated&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Smart contract deployed at: &lt;code&gt;0x148123bc5b719a7e169ee652a72be387c964b6f4&lt;/code&gt; on Base Sepolia&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Scenario Types
&lt;/h3&gt;

&lt;p&gt;Six different scenarios using real Pyth historical data:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Breakout&lt;/strong&gt; - Trend compression snaps into expansion&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Crash&lt;/strong&gt; - Violent downside unwind&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Chop&lt;/strong&gt; - Whipsaw price action&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fakeout&lt;/strong&gt; - Momentum looks clean until the floor disappears&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Slow Bleed&lt;/strong&gt; - Long, draining descent&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Volatility Spike&lt;/strong&gt; - Wide candles and sharp reversals&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Gamification System
&lt;/h2&gt;

&lt;h3&gt;
  
  
  XP &amp;amp; Leveling
&lt;/h3&gt;

&lt;p&gt;Players earn 500 XP per level with unlimited progression.&lt;/p&gt;

&lt;h3&gt;
  
  
  7-Day Streak System
&lt;/h3&gt;

&lt;p&gt;Build streaks by claiming daily rewards with multipliers from ×2 to ×14:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Day&lt;/th&gt;
&lt;th&gt;Base Reward&lt;/th&gt;
&lt;th&gt;Multiplier&lt;/th&gt;
&lt;th&gt;Total Potential&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;100 coins&lt;/td&gt;
&lt;td&gt;×2&lt;/td&gt;
&lt;td&gt;200 coins&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;150 coins&lt;/td&gt;
&lt;td&gt;×4&lt;/td&gt;
&lt;td&gt;600 coins&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;200 coins&lt;/td&gt;
&lt;td&gt;×6&lt;/td&gt;
&lt;td&gt;1,200 coins&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;250 coins&lt;/td&gt;
&lt;td&gt;×8&lt;/td&gt;
&lt;td&gt;2,000 coins&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;300 coins&lt;/td&gt;
&lt;td&gt;×10&lt;/td&gt;
&lt;td&gt;3,000 coins&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;350 coins&lt;/td&gt;
&lt;td&gt;×12&lt;/td&gt;
&lt;td&gt;4,200 coins&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;500 coins&lt;/td&gt;
&lt;td&gt;×14&lt;/td&gt;
&lt;td&gt;7,000 coins&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The multiplier also applies to session earnings.&lt;/p&gt;

&lt;h2&gt;
  
  
  Supported Assets
&lt;/h2&gt;

&lt;p&gt;13 major cryptocurrencies using official Pyth price feeds:&lt;/p&gt;

&lt;p&gt;BTC, ETH, SOL, BNB, XRP, ADA, DOGE, AVAX, POL, LINK, UNI, ATOM, PYTH&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Challenges Solved
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Challenge 1: Hydration Errors
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Server-rendered HTML didn't match client-rendered HTML for wallet-dependent UI.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: Added mounted state to only render wallet UI after client-side hydration.&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="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;mounted&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setMounted&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nf"&gt;useEffect&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="nf"&gt;setMounted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&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="c1"&gt;// Only render wallet-dependent UI after mount&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;mounted&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;isConnected&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;suppressHydrationWarning&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;balance&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;coins&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Challenge 2: Entropy Callback Timing
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Entropy V2 callbacks take 1-2 blocks, creating UX uncertainty.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: Implemented polling with status tracking to show real-time progress.&lt;/p&gt;
&lt;h3&gt;
  
  
  Challenge 3: Rate Limiting
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Free Pyth API has rate limits.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: Upgraded to Pyth Pro for 1,000+ requests per minute.&lt;/p&gt;
&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Pyth Network is Production-Ready
&lt;/h3&gt;

&lt;p&gt;The Hermes API is fast, reliable, and well-documented. Pyth Pro's enhanced rate limits made development smooth.&lt;/p&gt;
&lt;h3&gt;
  
  
  Entropy V2 is a Game-Changer
&lt;/h3&gt;

&lt;p&gt;Having verifiable on-chain randomness opens up possibilities for fair gameplay mechanics that weren't possible before.&lt;/p&gt;
&lt;h3&gt;
  
  
  Gamification Works
&lt;/h3&gt;

&lt;p&gt;Adding XP, levels, and streaks transformed a simple replay tool into an engaging training platform.&lt;/p&gt;
&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;After building Oracle Gym:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ 13 Pyth price feeds integrated&lt;/li&gt;
&lt;li&gt;✅ Entropy V2 smart contract deployed and working&lt;/li&gt;
&lt;li&gt;✅ 300+ wallet support via Wagmi v3&lt;/li&gt;
&lt;li&gt;✅ Sub-second page loads with Next.js 15&lt;/li&gt;
&lt;li&gt;🎮 Average session: 8-12 minutes&lt;/li&gt;
&lt;li&gt;📈 Most popular assets: BTC (45%), ETH (30%), SOL (15%)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Try It Yourself
&lt;/h2&gt;

&lt;p&gt;Want to test your trading skills?&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
      &lt;div class="c-embed__body flex items-center justify-between"&gt;
        &lt;a href="https://orcale-gym.vercel.app/" rel="noopener noreferrer" class="c-link fw-bold flex items-center"&gt;
          &lt;span class="mr-2"&gt;orcale-gym.vercel.app&lt;/span&gt;
          

        &lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;Connect your wallet, get 1,000 free coins, and start training!&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;Future improvements planned:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Multiplayer mode&lt;/strong&gt; - Compete against other traders in real-time&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;More assets&lt;/strong&gt; - Add forex, commodities, and stocks&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom scenarios&lt;/strong&gt; - Let users create and share scenarios&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mobile app&lt;/strong&gt; - React Native version&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tournament system&lt;/strong&gt; - Weekly competitions with prizes&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Building Oracle Gym taught me that &lt;strong&gt;real data makes all the difference&lt;/strong&gt;. When you practice with actual market conditions, you learn patterns that matter.&lt;/p&gt;

&lt;p&gt;Pyth Network's price feeds and Entropy V2 made it possible to create a training platform that feels authentic. The combination of real data, verifiable randomness, and gamification creates an engaging learning experience.&lt;/p&gt;

&lt;p&gt;If you're building anything that needs reliable oracle data or on-chain randomness, check out Pyth Network.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Built for the Pyth Community Hackathon 2026&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What would you build with Pyth Network?&lt;/strong&gt; Drop a comment below! 👇&lt;/p&gt;

</description>
      <category>web3</category>
      <category>blockchain</category>
      <category>typescript</category>
      <category>nextjs</category>
    </item>
  </channel>
</rss>
