Loops HousePE
perpetua

Event
NEAR HACKATHON
Links
Team
1 member- AYOwner
ayomi
Overview
Perpetua is an AI-generated encyclopedia on NEAR Protocol where every factual claim is backed by a perpetual binary prediction market. Market probabilities act as live epistemic confidence scores, encyclopedia articles re-render as probabilities move, and contested claims are settled optimistically by an attested 3-model Confidential TEE AI jury via NEAR AI Cloud.
What we built across the stack:
- Rust Smart Contract (contract/, near-sdk 5.30.1): Complete-set + constant-product (x*y=k) binary AMM using checked U256 integer math (zero floats), segregated fee_pool and 1:1 backed collateral_vault, storage-delta accounting, perpetual epoch rollovers, optimistic escalation with 2x bond counter-challenges, historical epoch redemption, and callback-safe payout recovery.
- Offchain Services (services/, Node + TypeScript + SQLite): RPC indexer, bounded public-HTTPS evidence fetcher with SSRF guards, parallel 3-model Confidential TEE jury runner (DeepSeek-V4.1-Flash, Qwen3.6-35B, GLM-5.3-Flash) with local Ed25519 signature and preflight nonce verification, deterministic confidence article generator (Qwen3-VL-30B-A3B-Instruct) committing SHA-256 page hashes on-chain, and 1Click NEAR Intents quote preview API.
- Web App (web/, Next.js + @hot-labs/near-connect): Live NEAR Testnet contract integration (570dcb106c2e8797eb86646401cffa35dd07ea08e40a49f2973453722584ff03 with 24 seeded Web3 claims) plus Demo Ledger mode, live trade quotes, sentence-level confidence highlighting, SVG price charts, and full dispute/settlement/payout controls.