โ† Back to home

HedgX

HedgX is a rates trading DeFi protocol. Here, users can trade Perps funding rates and yield rates.

Problem Statement

What is HedgX?In DeFi, almost every user is exposed to floating interest rates. Borrowers on protocols like Aave watch their costs spike unpredictably when utilization rises. Liquidity providers and stakers see their yields collapse when incentives drop. Perpetual traders on Binance or Bybit pay volatile funding rates that can swing against them for weeks at a time. Today, there is no simple, on-chain way to lock in fixed rates or hedge this risk.HedgX solves this problem.HedgX is a DeFi protocol for interest-rate derivatives, inspired by Interest Rate Swaps in TradFi and adapted to crypto. We introduce Hedge Notes (HN)- tradable tokens that represent Long and Short positions on interest rates. This creates the first accessible, on-chain market to hedge or speculate directly on interest rate movements.How it Works? Minting: HNs are always minted in pairs (one Long, one Short) with equal collateral. This ensures balance.Positions:Long HN = pay fixed rate ๐พ, receive floating rate ๐น Short HN = pay floating ๐น, receive fixed ๐พSettlements: Every epoch (e.g., 8 hours), positions exchange cashflows based on the difference between floating and fixed rates.ฮ”PnL = ๐‘ โ‹… (๐นโˆ’๐พ)โ‹…ฮ”๐‘ก/365WhereN = notional, F = floating APR in that epoch, K = fixed APR at entry.Token value of HN is defined by a decaying formula and become zero at expiry.Exiting Early: Users can close positions by selling their HNs on the orderbook (future versions will add Vault-based liquidity).Who Uses HedgX? Long Perps traders on Binance to go long HN Short Perps trader on Binance to go short HN Borrowers (e.g., on Aave) โ†’ hedge rising debt costs โ†’ go Long HN. Lenders / LPs โ†’ hedge falling yields โ†’ go Short HN. Speculators โ†’ bet on the direction of interest rates by trading HNs.Why it Matters?Just as perpetual futures revolutionized crypto price discovery, HedgX creates a new market for crypto interest rates. This allows users to manage risk, design structured products, and unlock a deeper layer of DeFi efficiency.

Solution

Built with a modern tech stack combining smart contracts, AI inference, and cross-chain infrastructure:Smart Contracts (Solidity):Custom HedgX Vault contract managing positions, orders, and settlementsNo-collateral system with dynamic HN token pricingAutomated PnL calculation and position managementCross-chain compatible architecture Frontend (Next.js + TypeScript):React-based trading interface with real-time dataThirdweb SDK for wallet integration and contract interactionsDynamic chain switching with context managementResponsive UI with Tailwind CSS and shadcn/ui componentsAI Integration (0G Compute Network):Server-side API routes for secure AI inferenceDeepSeek R1 70B and Llama 3.3 70B models for rate forecastingPrivate key management with environment variablesDynamic imports to handle Node.js dependencies in browserCross-Chain Architecture:Multi-network contract deployment (Sepolia, Citrea, Rootstock)Dynamic contract address resolution based on selected chainUnified UI experience across different networksChain-specific RPC endpoints and configurationsNotable Technical Solutions:Custom Orderbook and Matchmaking contract of complex ordersBuilt real-time settlement countdown with epoch managementImplemented server-side AI routesDeveloped context-aware currency formatting (BTC vs ETH display)The platform demonstrates advanced DeFi primitives with AI augmentation, providing a seamless cross-chain trading experience for funding rate derivatives.

Hackathon

ETHGlobal New Delhi

2025

Contributors