The ultimate security-first DeFi infrastructure layer and no-loss World Cup speculation network on X Layer.
Built for the X Layer Build X Season 2 AI Hackathon (Winner of 3rd Place) and expanded with Pitchside AI (Autonomous World Cup Speculation Network) for the X Layer X Cup Hackathon (May 19 - May 28, 2026).
- Why Pitchside AI Wins (Judge Checklist)
- The Problem & Our Solution
- Ecosystem Components
- Pitchside AI - Autonomous World Cup Speculation (New Feature)
- Autonomous AI Agent (TEE)
- OnchainOS Integration Deep-Dive
- x402 Agent Economy
- Model Context Protocol (MCP)
- Smart Contract Deployments
- Local Setup & Testing
- Onchain Verification for Judges
- Live Endpoints & Infrastructure
Pitchside AI goes far beyond a simple MVP prediction market. It implements state-of-the-art Web3 architectural paradigms:
- 100% Principal Protection (Zero Loss Staking): Staked USDT is not bet. Instead, on Mainnet, it is supplied directly to Aave V3 Pools using ProductionNoLossVault.sol. The principal remains 100% safe, while virtual yield (Scout Credits) is generated for risk-free speculation.
- Hardware-Grade Agent Security (TEE): The autonomous scout runs inside a secure Trusted Execution Environment (TEE) using the
okx-agentic-walletSDK. Private keys are securely sealed inside hardware enclaves and can never be extracted by the host application. - OKX NFT Marketplace Indexing: Dynamic Player Shares are minted as standardized ERC-1155 tokens onchain using PlayerShares.sol. Standardized metadata is served dynamically via our API endpoint so that player index shares can be indexed, bought, and sold instantly on the OKX NFT Marketplace.
- Decentralized, Block-Derived Leaderboard: Unlike centralized databases, our leaderboard inside Leaderboard.tsx queries the X Layer blockchain in real-time. It scans
DepositedandAgentDelegatedevent logs to fetch active participants, calculate their pool share, and pull TVL and credits directly from the smart contract. - Professional Live Data Pipeline: Integrates Sportradar Soccer API v4 for professional-grade live match data on Mainnet, with ESPN public scoreboard as a fallback. Live scores, match status, and player events feed directly into the TEE Scout Agent for autonomous trading.
- Security-First Aggregator: ShieldSwap integrates
okx-dex-swapto search 500+ DEX pools, but intercepts all swaps with ScanGuard MCP to warn users and block toxic token interactions before they hit the blockchain.
With the proliferation of L2 tokens and AI-driven trading, malicious actors deploy honeypots, hidden taxes, and toxic bytecode to drain liquidity. Centralized DEX routers execute swaps blindly, and AI agents lack a standard, machine-readable protocol to verify token safety natively before engaging.
Furthermore, sports prediction and speculation markets are traditionally high-risk, causing retail users to lose their hard-earned principal on bad predictions.
We built a dual-layer security and speculation ecosystem:
- For Humans: ShieldSwap, the first security-gated DEX Aggregator. If you attempt to swap a malicious token, the aggregator visually blocks the transaction with an interactive threat report.
- For World Cup Speculators: Pitchside AI (new feature built on ShieldSwap), a no-loss speculation loop where users stake stablecoins, accumulate virtual credits (yield), and delegate them to secure AI agents to trade player shares risk-free.
- For Machines: ScanGuard MCP, a native Model Context Protocol server that implements the x402 monetization standard. AI agents can query this server to get instantaneous, programmatic token risk data.
The Shield Suite monorepo is divided into four highly integrated packages:
The brain of the operation. A Node.js backend serving as both a RESTful API and a standard MCP Server.
- Executes Dual-Layer Scanning: Combines
okx-securityAPIs with a custom bytecode heuristics engine. - Manages the x402 Payment Loop, requiring micro-payments for access to its intelligence.
- Serves the World Cup Match & News Feed to drive the Pitchside speculation loop.
A glassmorphic, terminal-inspired frontend built in React/Vite.
- Integrates
okx-dex-swapto route trades across 500+ liquidity sources on X Layer, guaranteeing optimal routing. - Features a conversational AI Agent Chatbot seamlessly integrated directly into the trading UI, allowing users to scan tokens and stage trades using natural language.
- Hosts Pitchside AI - an interactive portal featuring DeFi staking, player market speculation cards, and live TEE agent execution logs.
A real-time command center for monitoring the entire ecosystem.
- Provides a live, WebSocket-style data stream of all tokens being actively scanned across the network.
- Cryptographically tracks the live balances and onchain heartbeat activity of the autonomous scanning agent.
A TEE-isolated Node.js loop running the autonomous agent scripts.
- Houses both the original ScanGuard cron monitoring agent and the new Pitchside World Cup Scout Agent scout.ts.
Pitchside AI is a World Cup-themed expansion developed specifically for the X Layer X Cup Hackathon. It builds on top of Shield Suite's core security layers, adding no-loss staking and dynamic index token speculation:
User Wallet
│
▼
[NoLossVault.sol]
(Deposit stablecoin → Yield)
│
(Delegates Scout Credits)
│
▼
[Scout Agent (TEE)]
(Uses okx-agentic-wallet)
│ │
(1. Scan token) │ │ (2. Swap shares)
▼ ▼
[ScanGuard MCP] [PlayerDex.sol]
│ │
▼ ▼
`okx-security` [PlayerShares ERC-1155]
-
ProductionNoLossVault.sol(Aave V3 Staking Vault): On X Layer Mainnet, staked USDT is securely supplied to Aave V3 pools under the hood to generate real interest. Capital is 100% protected and withdrawable at any time. Accumulated interest is harvested to fund the reward prize pool. -
PlayerShares.sol(Dynamic Player Index): An ERC-1155 contract representing synthetic player shares. Ratings and metadata update dynamically onchain. Serves standardized metadata JSON schemas for secondary trading integration on OKX NFT Marketplace. -
PlayerDex.sol(AMM Swap Engine): A custom AMM enabling zero-slippage, credit-backed trading of Player Shares. Features decimal and yield rate synchronization ($10^{12}$ factor) to natively support both 6-decimal USDT and 18-decimal virtual credits. -
TEE Scout Agent (
scout.ts): Fetches match news, evaluates sports sentiment, validates bytecode safety via ScanGuard API, updates player ratings onchain, and executes swaps automatically. -
Dynamic Onchain Ratings & Pricing: The TEE Scout Agent dynamically updates player ratings and statistics onchain (via
PlayerShares.updatePlayer(...)) when it parses positive or negative news events. Since the share price in thePlayerDexAMM is calculated directly from the onchain rating, these match updates automatically shift player share valuations in real time, allowing early spec-buyers to cash out their profits. - Dynamic Onchain Leaderboard: A network-aware leaderboard component that queries the active blockchain (scanning Deposited and AgentDelegated contract events) to fetch users' credits and staked values in real time on both Testnet and Mainnet. Features a 2-week campaign system with Pre-Season Warm-Up (testnet) and Season 1 Group Stage (mainnet) countdown timers.
We have deployed an autonomous Node.js agent running 24/7. It continuously invokes the ScanGuard API to monitor the top 11 X Layer core tokens (WOKB, USDC, USDT, USDe, etc.) for emerging threats.
- Institutional Security: Utilizes the
okx-agentic-walletbacked by a Trusted Execution Environment (TEE). The private key is strictly isolated and never exposed to the application runtime, rendering it immune to memory-dump attacks. - Onchain Checkpoints: Emits a literal
0 OKBtransaction on the X Layer ledger periodically. Attached to the transaction data is a UTF-8 encoded metadata string ("ScanGuard Cycle Success"), acting as an immutable public heartbeat proving the agent's uptime.
Our application deeply leverages the OKX OnchainOS ecosystem to provide routing, analytics, and wallet controls:
| SDK Module | Implementation Details |
|---|---|
okx-security |
Powers the core threat-detection engine (honeypots, taxes, proxy checks) for ScanGuard and agent safety checks. |
okx-dex-swap |
Used in our ShieldSwap frontend to generate highly optimized, low-slippage trade execution call data natively across all aggregated X Layer DEXs. |
okx-dex-token |
Provides real-time token metadata, market caps, token logo fetching, decimal standardization, and address validation. |
okx-agentic-wallet |
Secures the TEE Autonomous Scout's private key within a secure hardware enclave, enabling trustless delegation. |
okx-x402-payment |
Facilitates the cryptographic verification and conceptual architecture for streaming micropayments from client agents. |
ScanGuard pioneers a monetized API standard for AI agents via x402 Payment Required:
- Request: An external AI agent calls
POST /api/scanwithout authorization. - Denial: Server returns
HTTP 402 Payment Requiredwith instructions to pay $0.005 USDC. - Payment: The agent signs and broadcasts the stablecoin transaction natively on X Layer.
- Verification: The agent retries the request providing
X-402-Payment: <signed-receipt>. - Fulfillment: The server confirms the onchain transfer and returns the security report.
(Note: In the live demo environment, the protocol operates in "LIVE Subsidized" mode to prevent endlessly draining the agent's real USDC funds over a continuous 24/7 uptime window, while openly logging the gross revenue metrics on the Dashboard).
ScanGuard exposes an HTTP MCP server that any standard AI client can query natively to give them "X Layer vision".
curl -X POST http://38.49.216.120:3402/mcp/tools/call \
-H "Content-Type: application/json" \
-d '{"name":"scan_token","arguments":{"tokenAddress":"0x779ded0c9e1022225f8e0630b35a9b54be713736"}}'{
"mcpServers": {
"scanguard": {
"url": "http://38.49.216.120:3402/mcp",
"description": "Native security scanning for ERC-20 tokens on X Layer"
}
}
}- Real USDT (USDT0):
0x779Ded0c9e1022225f8E0630b35a9b54bE713736 - NoLossVault (Aave V3 Pool):
0xe8a63b4a905d9c1c2262f261dee90478d6ffd3de - PlayerShares:
0xb1cc05dc0a0b70fabc6bbb1b3043ba386c86d7e1 - PlayerDex AMM:
0xf2338b4ba18373070cdfd9f53da321fa12aa591b - TEE Agent Address:
0xDAce8445a5bD576111cCC8e598B67965252023C2
- MockUSDT:
0xe5E0795a8A61502409f304f391B615220d720fE9 - NoLossVault:
0x9E1A49480C1c1762A4B465F50c5cAAb86Aa3B046 - PlayerShares:
0xE8a63B4a905d9C1C2262F261dee90478d6fFD3De - PlayerDex AMM:
0xF2338b4Ba18373070cDfD9F53DA321fA12Aa591b - TEE Agent Address:
0xDAce8445a5bD576111cCC8e598B67965252023C2
npm installVerify that all staking, yield generation, and AMM trade constraints are fully functional:
cd contracts
npm run testnpm run devThis single command orchestrates:
- The Backend / API (Port
3402) - The ShieldSwap & Pitchside UI (Port
5175) - The Ecosystem Dashboard (Port
5174) - The Autonomous TEE Scout Agent
To verify the completion and execution of the Pitchside AI World Cup loop:
- Claim Faucet & Stake: Connect your wallet, claim 1,000 Mock USDT from the Faucet, and stake USDT in the No-Loss Vault.
- Delegate Agent: Select the Active TEE Scout Agent and click Confirm Delegation.
- Verify Live Data Feed: Click Verify Live Data Feed in the Scout Console to verify real-time match data from Sportradar Soccer API v4. Live matches show with a pulsing red indicator.
- Watch Agent React: The Scout Console will immediately reflect the agent detecting new match events, scanning token bytecode via ScanGuard, and executing transactions on the
PlayerDexcontract. - Verify Explorer: Copy the generated transaction hash and search it on X Layer Testnet Explorer to verify the TEE Agent called the swap on your behalf.
- Check the Leaderboard: The Global Scout Leaderboard shows your ranking, Scout Credits, staked amount, and pool share - all read directly from onchain contract events.
- Network: X Layer Mainnet (
Chain ID 196) - ShieldSwap Application: https://shieldsuite.xyz/
- ScanGuard Dashboard: https://dashboard.shieldsuite.xyz/
- Central API Node & MCP Host:
railway - TEE Agent Identity (X Layer):
0xDAce8445a5bD576111cCC8e598B67965252023C2
- Developer: MrNetwork
- Email: mrnetwork0001@gmail.com
- X (Twitter): @encrypt_wizard