Trigslink
AI-curated prediction markets resolving real-world events in <15s via Chainlink CRE.
What it is
Trigslink: AI-Augmented Decentralized Prediction Markets
What it is:
Trigslink is a fully autonomous, decentralized prediction market protocol. By layering Chainlink’s new Custom Runtime Environment (CRE) over our Sepolia smart contracts, Trigslink utilizes a decentralized mesh of Large Language Models (LLMs) to automatically curate permissionless market proposals, prevent spam, and resolve bets based on real-world data in under 15 seconds.
The Problem it Solves:
Existing prediction markets suffer from three critical flaws that cripple user experience and capital efficiency:
- Centralized Creation vs. Permissionless Spam: Major prediction markets are highly centralized—only the core team can create markets to ensure quality control. Platforms that do allow permissionless creation are immediately flooded with spam, paradoxical questions, and poorly defined rules.
- The "Zombie Period" & Slow Settlement: When a real-world event concludes, user capital is trapped in a frustrating "zombie period." Settling the market relies on subjective human voting committees, centralized oracles, or drawn-out dispute windows that lock liquidity for days or weeks.
- Single Point of Failure in AI: Protocols experimenting with AI oracle resolution typically rely on a single, centralized model, leaving the system highly vulnerable to hallucinations, bias, or API downtime.
How it Works (The Solution):
Trigslink completely abstracts away the slow human element of market curation and resolution utilizing the Chainlink CRE v1.3.0 WASM Sandbox. The architecture is divided into two continuous off-chain workflows: - Phase 1: The Gatekeeper (Permissionless Curation & Spam Prevention)
When a user stakes ETH to propose a new market on-chain, the CRE sandbox instantly catches the MarketProposed EVM log. It securely fetches API keys using runtime.getSecret() and prompts our Multi-Model Consensus Mesh (Gemini 2.5 Flash, Llama-3 70B via Groq, and Mistral via OpenRouter). The AI mesh evaluates the proposal for logical consistency, future-facing timelines, and verifiable data sources. If the AI mesh does not reach a 2/3 majority "VALID" consensus, the CRE flags the market as spam on-chain, immediately slashing the stake. This allows anyone to create a market, while perfectly protecting the protocol from junk. - Phase 2: The Truth Engine (Sub-15-Second Resolution)
Users place ETH bets on the approved market. Once the market's timestamp expires, anyone can call requestSettlement(). The CRE listens for this event, uses its HTTPClient to proxy a web-scraping request through Jina AI, and reads the live context of the market's specific data source. The scraped text and the original question are fed back into the AI Consensus Mesh. The mesh independently calculates the truth, reaches a 2/3 majority consensus, and pushes the final verdict back on-chain via the Chainlink DON.
The Result: We've eradicated the zombie period. What used to take a 3-day human dispute window now takes less than 15 seconds. Trigslink guarantees that markets are permissionless to create, yet resolved objectively, deterministically, and incredibly fast—unlocking the true potential of high-frequency decentralized prediction markets.
How it Works
How it's Built: A Deep Dive into the Trigslink Architecture
Trigslink is a full-stack decentralized application (dApp) that orchestrates complex interactions between EVM smart contracts, off-chain computation, and a decentralized mesh of Large Language Models.
- The Smart Contract Layer (Solidity & Sepolia)
Our on-chain infrastructure is written in Solidity, deployed on the Ethereum Sepolia Testnet, and split into specialized contracts to ensure strict separation of concerns and robust economic security:
- TrigslinkGovernance.sol (The Gatekeeper): This contract handles permissionless market creation. To prevent sybil attacks, it requires an ETH stake to propose a market. It manages the state of the AI's spam verification and handles the community voting logic using our native ERC-20 token ($TRIGS). If a market passes, the contract automatically handles the ETH refunds and success rewards.
- TrigslinkVault.sol (The Settlement Engine): Once a market is approved, it is deployed here. The Vault manages the parimutuel liquidity pools, enforces the betting windows (locking bets after endTime), and handles the final payout math.
- Security: Both contracts utilize OpenZeppelin’s ReentrancyGuard to protect user funds during stakes, bets, and payout claims.
- The Off-Chain Oracle Engine (Chainlink CRE v1.3.0)
To completely replace slow, centralized backends and traditional Oracle setups, Trigslink's core logic runs entirely inside the Chainlink Custom Runtime Environment (WASM Sandbox). We wrote a continuous TypeScript workflow that acts as the nervous system of the protocol:
- Asynchronous Event Listeners: We utilize evmClient.logTrigger to natively listen to the blockchain. The moment a MarketProposed or SettlementRequested log is emitted on Sepolia, the CRE wakes up instantly.
- Secure API Management: We use the DON's runtime.getSecret() to securely inject API keys for our AI providers directly into the WASM environment, ensuring credentials are never exposed on-chain.
- Overcoming WASM Memory Traps: During development, passing raw EVM hex logs caused the underlying Go-to-WASM converter to panic. We engineered a bulletproof hex-to-base64 sanitization parser (hex.replace(/^0x/, "")) to strip prefixes, successfully stabilizing the Chainlink event bridge.
- The Decentralized AI Consensus Mesh
Relying on a single LLM (like OpenAI) creates a centralized point of failure and leaves the protocol vulnerable to hallucinations. We engineered a Multi-Model Consensus Aggregator:
- Parallel Execution: Our CRE TypeScript script executes parallel HTTP requests to three distinct LLMs: Gemini 2.5 Flash (for complex logic and reasoning), Llama-3 70B via Groq (for high-speed, low-latency chronological checks), and Mistral via OpenRouter (for objectivity and bias auditing).
- Deterministic Consensus: The script parses the JSON responses from all three models and mathematically enforces a strict 2/3 majority vote. Anomalies and hallucinations are automatically discarded. Only when consensus is reached does the CRE trigger the Chainlink Forwarder to write the verdict on-chain.
- Live Web Data Ingestion (Jina AI Proxy)
To resolve real-world events, the AI needs to read the live internet, but heavy web-scraping libraries (like Puppeteer) cannot run inside the lightweight CRE WASM sandbox.
- The Solution: We utilize the CRE's httpClient to proxy the user's target URL through Jina AI (r.jina.ai). This takes heavy, complex HTML pages and converts them into clean, lightweight Markdown on the fly. This allows the AI mesh to ingest thousands of words of real-time web context with a single, highly efficient HTTP GET request.
- The User Interface (React & Web3)
The frontend is built with React and styled using Tailwind CSS to deliver a dark, high-contrast, professional "cyberpunk" aesthetic.
- Routing & State: We use React Router for seamless single-page navigation between the Home Grid, the AI Governance Hub, and Watchlists.
- Web3 Integration: Wallet connections and transactions are handled using ethers.js and @reown/appkit (WalletConnect), allowing users to easily stake ETH, mint $TRIGS, and place cross-market bets.
Links
Created by
- Aakash Jaiswal
- Gianluca Godfrey