hackquest logo

VeraSignal

VeraSignal is a verifiable market intelligence oracle for DeFi. It reads live position data from the Uniswap V3 fork deployed on 0G Chain, classifies wallets as smart money or retail using a TEE-verif

视频

项目图片 1

技术栈

Next
Ethers
Node
Solidity

描述

VeraSignal is a verifiable market intelligence oracle for decentralized finance. It solves a fundamental trust problem in DeFi analytics: any system can claim to classify wallets as "smart money" or flag liquidation danger zones but there is no way to prove the AI reasoning wasn't manipulated or fabricated after the fact. VeraSignal makes every piece of market intelligence cryptographically provable. It ingests on-chain position data from DeFi protocols, runs wallet classification and liquidation signal generation inside a Trusted Execution Environment (TEE) via 0G Compute's Sealed Inference, and publishes the resulting signals to a Solidity oracle contract on 0G Chain. Each published signal carries a teeProofHash a keccak256 hash of the ZG-Res-Key TEE attestation header which anyone can independently verify on-chain.

The product has three integrated 0G modules:

1. 0G Compute (Sealed Inference / TEE): Wallet classification AI runs inside a hardware-isolated TEE enclave via @0glabs/0g-serving-broker. Every inference response is attested by the TEE hardware and returns a ZG-Res-Key header that is verified using broker.inference.processResponse(). The keccak256 of this key is stored on-chain as the teeProofHash, making the AI's output independently auditable.

2. 0G Chain (Smart Contract): VeraSignalOracle.sol is deployed on 0G Chain mainnet (chainId 16661, address 0x641822A13272b91af7D64245871523fD402156d6). The backend publishes danger zone signals on-chain after every heatmap rebuild cycle. Each Signal struct stores the market, price level, total USD at risk, smart money percentage, TEE proof hash, and timestamp. The contract emits SignalPublished events that any downstream DeFi protocol can consume.

3. 0G Storage KV: Historical heatmap snapshots are persisted every 5 minutes using the @0gfoundation/0g-ts-sdk Batcher API. This creates a permanent, verifiable record of market state over time, enabling the frontend's historical playback feature and allowing researchers to audit past liquidation cluster patterns. The frontend is a real-time dashboard built on Next.js 15 with D3 heatmap visualization, TradingView price charts, and a wallet profiler. Key UI additions over a standard DeFi dashboard include: TEE proof badges on every wallet classification, a live Oracle Feed panel showing on-chain signals with direct links to chainscan.0g.ai, and a historical playback scrubber that replays stored snapshots from 0G Storage.

Target users are DeFi traders and protocols that need verifiable, manipulation-resistant market intelligence to make position sizing, liquidation, and risk management decisions.

本次黑客松进展

Full-stack implementation completed across all planned components:

SMART CONTRACT - COMPLETE VeraSignalOracle.sol implemented with Signal struct, publisher access control, getLatestSignals() returning newest-first ordering, and SignalPublished events. Deployed to 0G testnet (chainscan-galileo.0g.ai) with 37 confirmed transactions. Deployed to 0G mainnet (chainId 16661): 0x641822A13272b91af7D64245871523fD402156d6 - https://chainscan.0g.ai/address/0x641822A13272b91af7D64245871523fD402156d6. Foundry test suite: 8 tests covering access control, storage, events, ordering, and edge cases — all passing.

BACKEND - NODE.JS / TYPESCRIPT - COMPLETE chainPoller.ts reads Uniswap V3 Swap events from 0G Chain mainnet pools with price derivation from sqrtPriceX96, pool metadata caching, and account discovery. computeClient.ts is a full 0G Compute TEE integration via @0glabs/0g-serving-broker classifies wallets using GPT-OSS-120b inside a TEE enclave, reads ZG-Res-Key header, runs broker.inference.processResponse() for attestation, and computes teeProofHash as keccak256(chatID). Local classifier fallback when TEE is unavailable. contractPublisher.ts publishes top 5 danger zone buckets per market per rebuild cycle to VeraSignalOracle.sol and reads on-chain signals for the /api/signals route. storageWriter.ts persists heatmap snapshots to 0G Storage KV every 5 minutes via @0gfoundation/0g-ts-sdk Batcher API. API extended with /api/signals (on-chain oracle data), /api/history (snapshot keys), /api/wallet/:address now returns teeProofHash and teeVerified fields. Mock data mode keeps all three 0G integrations active on simulated positions. 37 Jest tests passing.

FRONTEND - NEXT.JS 15 - COMPLETE TeeProofBadge component renders an inline verified/unverified pill with hash copy-to-clipboard. OracleFeed component shows live on-chain signal cards polling /api/signals, each card links to the corresponding chainscan.0g.ai transaction. HistoryPlayback component provides a timeline scrubber for stored snapshots. WalletLookup extended with TEE proof badge. 33 Playwright E2E tests passing.

DOCUMENTATION - COMPLETE README covers what it does, 0G integration table, ASCII architecture diagram, mainnet and testnet contract addresses, full local setup, environment variable reference, API endpoint table, and a TEE proof verification guide. Setup scripts included: list-providers.ts to discover TEE provider addresses, create-stream.ts to generate 0G Storage stream ID, discover-pools.ts to scan Uniswap V3 pools on 0G Chain mainnet.

DELIVERABLES Demo video recorded and published. Public X post published with demo clip. Total: 70 tests (37 Jest + 33 Playwright), 3 active 0G module integrations, 1 mainnet contract deployed with on-chain activity.

融资状态

Not raised. Solo developer, bootstrapped. Open to ecosystem grants from 0G Foundation post-hackathon if the project qualifies. No external investors, no active fundraising round.

队长
NNiko Bash
项目链接
部署生态
0G0G
赛道
InfraOtherAI