Shield: PhylaX is an AI execution firewall for OKX X Layer. Before users sign, PhylaX checks the trade.
Built for the Build X-Agent Hackathon
Participant ID:
Participant ID:
2054917885347762176
You type: "Swap 50 USDC to OKB on X Layer"
PhylaX does:
- Parses your intent via AI agent planning
- Scans both tokens for honeypots & rug risks (OKX Security skill)
- Fetches optimal quote across 500+ DEX routes (OKX DEX Swap skill)
- Checks allowance and generates approval tx if needed
- Builds unsigned transaction — server never broadcasts, you sign
- Confirms on-chain after your wallet submits
Note: For this hackathon, X Layer is the only active executable chain. PhylaX is not a multi-chain live product yet, and features like OKX Agentic Wallet or x402 are future extensions, not part of current demo scope.
| Skill | What PhylaX Uses It For | CLI Command |
|---|---|---|
okx-dex-signal |
Discover trending tokens on X Layer | onchainos signal list |
okx-security |
Dual token risk scan before every trade | onchainos security token-scan |
okx-dex-swap |
Get quotes + build swap transactions | onchainos swap quote |
okx-dex-token |
Resolve token addresses by symbol | onchainos token search |
okx-wallet-portfolio |
Check wallet balances before execution | onchainos portfolio token-balances |
okx-onchain-gateway |
Gas estimation + transaction simulation | onchainos gateway gas, gateway simulate |
okx-agentic-wallet |
Wallet status and account info | onchainos wallet status |
okx-audit-log |
Audit log path for troubleshooting | Local path resolution |
The codebase integrates directly with the OKX Onchain OS through lib/okx.ts at runtime.
- Agentic Proactive UX — instead of a passive prompt-box, the agent proactively asks clarifying questions to guide users through swap intent formation.
- DeepSeek & Claude Fallback — built-in dual-LLM provider abstraction. Uses Anthropic Claude as primary, with automatic zero-downtime fallback to DeepSeek V4 if credits exhaust.
- Dual token scan — scans both
fromTokenANDtoTokenbefore any quote. Most agents scan only once. - Robust Token Resolution — hardcoded shortcuts and decimal fallbacks for major assets (USDC, USDT, WETH).
- No-broadcast guarantee —
/api/executereturns only unsignedtxData. Server never touches your funds. - Approval replay prevention — each approval ID is one-time use, expires in 5 minutes, consumed atomically via Redis.
- Onchain tx verification — verifies approval tx
from,to, and method selector before proceeding. - Kill switch — operator can pause all live execution instantly via environment flag without redeploying.
git clone https://github.com/Rzbyte/PhylaX
cd PhylaX
npm install
cp .env.example .env
npm run dev| Variable | Purpose |
|---|---|
ANTHROPIC_API_KEY |
Primary LLM provider |
DEEPSEEK_API_KEY |
Fallback LLM provider |
REDIS_URL |
Approval token storage |
OKX_* |
OKX Onchain OS credentials |
User intent
-> AI Agent (Claude / DeepSeek fallback)
-> Security scan (dual token, okx-security)
-> Quote fetch (500+ DEX routes, okx-dex-swap)
-> Allowance check + approval tx (Redis, 5min TTL)
-> Unsigned tx returned to user
-> User signs + broadcasts
-> On-chain confirmation (okx-onchain-gateway)
MIT
