
Pooka Finance
AI-Powered Cross-Chain Perpetuals Trading Platform
Demo
About
The problem it solves # The Problem Pooka Finance Solves ## The Cross-Chain Trading Nightmare That's Costing You Money **You see the perfect trade setup, but your money is trapped** Bitcoin just broke through resistance on your favorite Avalanche perpetuals platform. You know this could be a 20% move in hours. Your timing is perfect. **But your trading capital is sitting in USDC on Ethereum.** Now you're faced with the soul-crushing reality: - **Bridge your USDC**: 20-30 minutes waiting time - **Pay bridge fees**: $15-50 in gas costs - **Watch the opportunity slip away**: By the time your funds arrive, Bitcoin pumped 15% - **Kick yourself**: Right analysis, wrong chain This happens **every single day** to thousands of traders. The most profitable setups don't wait for your slow bridging transactions. **The complexity trap is eating your profits** **"What the hell is a maintenance margin?"** You open what seems like a safe 2x position, only to get liquidated overnight because you didn't understand your maintenance margin dropped below 5%. Nobody explained holding fees were eating your collateral. **You lose $500 learning what you should have known before your first trade.** Platforms expect you to figure out liquidation prices, risk ratios, position sizing, and profit-taking. **Meanwhile, sophisticated traders with bots are eating your lunch** because they understand these mechanics. **Liquidations are a rigged game** **MEV bots watch your position like vultures.** When you become liquidatable, they front-run the liquidation to ensure you get liquidated first while larger positions with the same risk somehow survive. **It's literally rigged.** Sophisticated players have advantages you don't even know exist. **You're missing life-changing opportunities daily** The best opportunities happen when you're asleep, at work, or when your funds are bridging. **Every day you're not trading efficiently is money left on the table.** **The current perpetuals experience is broken, unfair, and designed for institutions, not regular traders.** --- ## How Pooka Finance Eliminates Every Single Pain Point **Your money works anywhere, anytime** **No more missed opportunities.** Deposit USDC on Ethereum, trade on Avalanche **instantly**. Our pre-funding architecture eliminates the 20-30 minute bridging delay killing your profits. When that perfect setup appears, you execute immediately regardless of where your money started. No bridges, no delays, no missed trades. **Multiple collateral types:** USDC, AVAX, LINK (and many more to come) - automatically converted to unified USDC trading. **Your personal expert trader powered by AI** **"Open a long position on BTC with $100 at 3x leverage"** Our AI handles: - Liquidation price calculations - Risk assessment warnings - Position sizing recommendations - Real-time profit/loss monitoring - Automated alerts before dangerous situations **No more getting liquidated because you didn't understand maintenance margins.** The AI explains everything in plain English and warns you before costly mistakes. **Finally, fair liquidations for everyone** **VRF randomization** ensures liquidations happen in truly random order. No more MEV bots front-running your liquidations while protecting whale positions. **Chainlink price feeds** provide the most accurate, tamper-proof pricing in DeFi. Your positions are valued fairly and liquidated fairly. **Never miss another opportunity** **24/7 position monitoring** means you never miss profit-taking opportunities or risk management alerts. The AI watches your positions around the clock. --- ## Why This Solution is 10x Better **The numbers don't lie** **Traditional perpetuals trading:** - 25+ minute setup time for cross-chain trades - 70% of retail traders lose money due to complexity - $2+ billion lost annually to MEV and unfair liquidations - Learning curve: 3-6 months to become profitable **Pooka Finance:** - Instant trading across any supported chain - AI guidance reduces learning curve to days - Fair liquidation system protects retail traders - Automated risk management prevents costly mistakes **We have first-mover advantage in an untapped market** Cross-chain perpetuals is **completely untapped**. Every major platform (dYdX, GMX, Synthetix) forces users onto specific chains. **We're not competing - we're creating an entirely new category.** Pooka Finance is the first AI-powered, fair, and cross-chain perpetuals platform.
How it's made
Challenges we ran into ## CCIP Cross-Chain Delay Problem **Issue:** When testing our cross-chain flow, Chainlink CCIP took 25 minutes to bridge tokens from Sepolia to Avalanche. This meant our demo flow would break - users would deposit USDC on Sepolia and then sit there waiting half an hour before they could show the trading functionality. **Solution:** We built a pre-funding architecture where the PoolManager on Avalanche immediately credits users when they deposit on Sepolia. The actual CCIP settlement happens in the background. This way our demo shows instant cross-chain trading while the system handles the complexity behind the scenes.  ## Liquidation Ordering Fairness **Issue:** Our liquidation system was processing users in a predictable first-come-first-served order. We realized this would create unfair advantages in production where MEV bots could exploit the predictable ordering. **Solution:** We integrated Chainlink VRF to randomize the liquidation order. Now when our automation contract triggers liquidations, it shuffles the user array randomly so the system is fair by design. ## Data Corruption in ETH/USD Streams **Issue:** During testing, ETH/USD data streams started returning values around $100k instead of the expected $3k range. This corrupted data would have caused our liquidation logic and trading interface to behave completely wrong. **Solution:** We built a comprehensive validation system with corruption detection and fallback tiers. Our useUnifiedPriceFeeds hook checks if prices fall within expected ranges using isDataCorrupted(). When corruption is detected, the system automatically falls back through multiple data sources: Price Oracle ( we created ) → DataStreams → OHLC API → Fallback values. We also documented the data streams issue and shared a [reproducible example ](https://github.com/Dhruv-Varshney-developer/Chainlink-Data-Streams) with the Chainlink team. (Bharath and others) ## Core Wallet Integration Struggles **Issue:** We wanted to support Avalanche's Core Wallet but the documentation was sparse. Our wallet connection kept failing and we couldn't figure out the proper integration patterns. **Solution:** We reached out to the Avalanche team directly. Ashutosh from their DevRel team helped us understand the integration requirements and got Core Wallet working with our platform. ## Transaction Sequencing Issues **Issue:** We were trying to send token approval and trade execution in parallel to speed up the user experience. But the second transaction would fail because the approval wasn't mined yet. **Solution:** We implemented sequential execution with 200ms delays between transactions. This ensures each step completes before the next one executes, making our transaction flow much more reliable. ## Cross-Chain Validation Problems **Issue:** During development, transactions would fail silently when we accidentally tried to call contracts on the wrong chain or when contracts weren't deployed where we expected. **Solution:** We added validation checks before every transaction to verify the contract exists on the expected chain and the user is connected to the right network. ## Deployment Script Reliability **Issue:** Our contract deployment scripts kept failing because they would try to deploy the next contract before the previous one was fully confirmed on the blockchain. **Solution:** We added proper wait mechanisms and timeout handling throughout our deployment process. Now, scripts wait for confirmations before proceeding to the next step. ## Testing Speed and Complexity **Issue:** Testing our cross-chain functionality was painfully slow because each test required real blockchain transactions and confirmations, taking 30-60 minutes per test cycle. **Solution:** We created mock contracts for rapid unit testing of core logic, while keeping integration tests for the full cross-chain flow. This lets us iterate quickly during development. ## Building Reliable Price Infrastructure **Issue:** We needed 24-hour high/low price data and reliable real-time prices, but individual data sources were unreliable. DataStreams had corruption issues, contract calls could fail, and APIs had rate limits. **Solution:** We built a unified price feed system with automatic failover between multiple data sources. The system tries Price Oracle first, then DataStreams, then OHLC API, and finally uses fallback values. Each source is validated for corruption before use. --- These weren't just bugs to fix - each challenge taught us something important about building reliable DeFi infrastructure. The solutions we built make our platform more robust and production-ready than a typical hackathon project.