Slides

https://www.canva.com/design/DAG6q413J_8/ueUsMEXcVqe0EcjkNEcw7g/edit?utm_content=DAG6q413J_8&utm_campaign=designshare&utm_medium=link2&utm_source=sharebutton

Inspiration

Helping businesses hedge real-world risks (travel, FX, supply chain) with onchain markets, using Base for low cost + account abstraction and Polymarket for deep liquidity.

What it does

  • Bridges USDC from Base Sepolia to Polygon Amoy via Circle CCTP, executes a Polymarket order (dryRun on testnet), then records the hedge on Base (gasless).
  • Mints an NFT receipt per hedge and surfaces a portfolio dashboard with BaseScan links.

How we built it

  • Frontend: Next.js, OnchainKit (SmartWallet + Paymaster), Wagmi, Ethers, Recharts, Tailwind.
  • Backend: FastAPI, Polymarket CLOB API (forced dryRun on testnet), OpenAI matching (stubbed via MOCK_MATCHING=1).
  • Contracts: HedgeRegistry (stores hedge + bridge tx + message hash) and HedgeReceiptNFT.
  • Bridging: Circle CCTP Base Sepolia → Polygon Amoy USDC.
  • Gas: Coinbase Paymaster sponsors the record step on Base.

Challenges we ran into

  • Provider selection defaulting to MetaMask instead of OnchainKit; fixed by forcing walletClient transport and preferring Coinbase/Base injecteds.
  • CCTP domain/allowance issues on testnet; hardcoded 0.1 USDC to minimize allowance/balance friction.
  • Polymarket mainnet vs testnet: dryRun required on Amoy.

Accomplishments that we're proud of

  • End-to-end gasless record flow on Base with paymaster.
  • Cross-chain UX: bridge → attestation → claim → trade → record.
  • NFT receipts per hedge and portfolio with explorer links.

What we learned

  • Account abstraction + paymasters greatly improve UX but require precise provider selection.
  • CCTP domain IDs and attestation timing are critical; small amounts reduce friction on testnets.
  • DryRun integration is handy for demos while keeping real order paths intact.

What's next for PolyHedge

  • Enable real Polymarket trades on mainnet and remove dryRun.
  • Add richer analytics (PnL, settlement) and multi-asset hedges.
  • Production paymaster routing and faster bridge options (e.g., LI.FI/Across) for demo speed.

Built With

  • base
  • circle
  • ethers
  • polygon
  • react
Share this project:

Updates