CROSS Prediction Market Skill
to-nexus/skill-cross-prediction
Trading de shares de eventos de previsão na CROSS Chain via linguagem natural
Ver no GitHubSkill de Claude Code que integra acesso ao mercado de previsões CROSS Chain, permitindo listagem de eventos, visualização de preços de orderbook, gerenciamento de carteira BILL/CROSS e execução de operações de compra/venda/resgate de shares de resultado binário. Suporta múltiplas estratégias de assinatura para transações EIP-712 em mainnet.
Instalação
npx convez-ai to-nexus/skill-cross-prediction1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Operar mercados de previsão binária com colateral BILL
- Gerenciar carteira de outcome shares (CTF) e saldos BILL/CROSS
- Executar estratégias de trading de resultados com filtros por evento
- Resgatar shares vencedoras e liquidar posições em mercados liquidados
Veredito

Skill robusto e bem estruturado para operações DeFi de previsão na CROSS Chain. Exige configuração cuidadosa de variáveis de ambiente (.env) e compreensão sólida de EIP-712, estratégias de assinatura e colateral em BILL. Ideal para traders técnicos que operacionalizarão previsões via Claude Code com proteções de dry-run.
README
A tradução para o português deste README ainda está na fila.
cross-prediction
A Claude Code skill that drives the CROSS Prediction Market at prediction.crossdefi.io on CROSS Chain (chain id 612055). Lists active events, fetches event/market details with live orderbook prices, shows BILL + CROSS wallet balance + CTF Share holdings, reads settled market results, places BILL-denominated YES/NO Share buy/sell through explicit wallet execution strategies, and redeems winning Shares back into BILL.
- Stack: Node 20+, viem
- Payment token: BILL (ERC-20 on CROSS Chain)
- Outcome representation: Conditional Token Framework (CTF) Shares
- Subcommands:
list-events,get-event,get-results,balance,buy,sell,redeem - Trading strategies: A (local viem signer) · C (configured CROSSx gateway signer)
- Live BILL API:
https://pred-bill-service-api.crossdefi.io/api/v1 - Distribution: standalone Claude skill and Claude Code plugin
⚠️ This skill submits real EIP-712 orders that lock BILL collateral against outcome shares. Trades are DRY-RUN by default; use
--liveto actually submit. Always setMAX_TRADE_BILLin.env. Readskills/cross-prediction/SKILL.mdand the relevant signer module before using.
Install — Recommended (via Marketplace)
/plugin marketplace add github.com/to-nexus/cross-skills-suite
/plugin install cross-prediction@cross-skills-suite
Part of the CROSS Skills Suite — installs alongside cross-dex-trade and other CROSS Chain ecosystem skills.
Install — Standalone
Option 1 — Plain skill (one user, fastest)
git clone https://github.com/to-nexus/skill-cross-prediction /tmp/skill-cross-prediction
bash /tmp/skill-cross-prediction/install.sh # symlinks into ~/.claude/skills/
Option 2 — Claude Code plugin (marketplace-installable)
If you maintain a marketplace, add an entry pointing at this repo:
{
"name": "cross-prediction",
"source": { "source": "github", "repo": "to-nexus/skill-cross-prediction" },
"category": "blockchain"
}
End users then run /plugin marketplace add <your-marketplace> then /plugin install cross-prediction.
Configuration
Copy the template and fill in the strategy-specific vars:
cp skills/cross-prediction/.env.example skills/cross-prediction/.env
chmod 600 skills/cross-prediction/.env
Required for all strategies:
| Variable | Description |
|---|---|
WALLET_ADDRESS | Your CROSS Chain EOA / embedded wallet address (0x + 40 hex) |
MAX_TRADE_BILL | Per-trade BILL notional cap. Default 100; recommend 10 for new users |
Strategy-specific:
| Strategy | Vars | One-time setup |
|---|---|---|
| A — local viem | local signer env/config | none |
| C — CROSSx gateway | PIN=123456 (6 digit) + configured gateway | maintainer-provided gateway config |
Optional: STRATEGY=A|C|auto to force a specific path. Default auto prefers A → C.
The skill resolves .env from (in order): cwd → ~/.claude/skills/cross-prediction/ → asks once.
Usage
Inside Claude Code, just describe in plain language:
- "list active prediction events"
- "BTC 1분 예측 이벤트 찾아줘"
- "show my BILL balance and active shares"
- "buy 10 YES shares of at max 0.55 BILL/share"
- "sell all my YES shares of "
- "show settled results for event "
- "redeem my winning shares for market "
Direct CLI (skipping Claude):
cd ~/.claude/skills/cross-prediction
# Read-only (works without any signer credentials)
node scripts/list-events.mjs --status ACTIVE --query "BTC"
node scripts/get-event.mjs <eventId>
node scripts/balance.mjs --with-shares
node scripts/get-results.mjs <eventId> --only-mine
# Mutations — DRY-RUN by default
node scripts/buy.mjs <marketId> UP 1
node scripts/sell.mjs <marketId> UP 1
node scripts/redeem.mjs <marketId>
# LIVE (auto-pick strategy from env; redeem requires Strategy A)
node scripts/buy.mjs <marketId> UP 1 --live
node scripts/buy.mjs <marketId> UP 1 --live --strategy A # force a specific strategy
node scripts/redeem.mjs <marketId> --live --strategy A
All commands emit a single JSON object on stdout (txHash, status, explorer URL, chosen strategy and reason).
Layout
skill-cross-prediction/ # repo root = plugin
├── .claude-plugin/
│ └── plugin.json # plugin manifest
├── install.sh # symlink installer
├── README.md
├── LICENSE
└── skills/
└── cross-prediction/ # the skill itself
├── SKILL.md # what Claude reads to drive the market
├── package.json # viem + playwright deps
├── .env.example
├── scripts/ # 20 .mjs subcommand modules
│ ├── _signer.mjs / _signer-a-viem.mjs / _signer-c-gateway.mjs
│ ├── _strategy.mjs # auto-router
│ ├── _auth.mjs / _order.mjs / _approval.mjs # SIWE + EIP-712 + on-chain approve
│ ├── _chain.mjs / _guard.mjs # viem client + safety
│ ├── buy.mjs / sell.mjs / redeem.mjs / balance.mjs
│ └── list-events.mjs / get-event.mjs / get-results.mjs
└── references/
├── api-map.md # discovered + TODO internal endpoints
├── chain-addresses.md # BILL + CTF/Exchange addresses
└── ctf-basics.md # 30s primer on Conditional Token math
Safety model
The skill enforces five independent rails (one more than cross-dex-trade):
- Chain-id check. RPC client re-verifies
eth_chainId == 612055and aborts on mismatch. - MAX_TRADE_BILL cap. Worst-case notional (
shares × maxPrice) compared to the cap before submission. - User confirmation. SKILL.md instructs Claude to require an explicit "yes / 진행" for any trade with notional > 1 BILL, rendering the parsed intent (event, side, price, amount, total, MAX cap, chosen strategy) as a human summary first.
- Address mismatch abort. Each strategy resolves an EOA at runtime (A: local signer derive; C: gateway lookup). If
WALLET_ADDRESSis set in env and the resolved address differs, abort withADDRESS_MISMATCH. - On-chain gap detection (Strategy C). Strategy C signs off-chain prediction orders through the configured gateway. On-chain approvals and
redeemrequire Strategy A unless a gateway tx path is explicitly configured.
Secrets handling: PRIVATE_KEY / PIN / SIWE-derived JWT never appear in the conversation transcript or in process argv (they go through set -a; source .env; set +a or process.env). .auth/state.json and .session/gateway.json are gitignored and never committed.
Limitations
- Prediction market only. Gametoken DEX (
x.crosstoken.io) is covered bycross-dex-trade. Forge / CrossDefi swap-bridge / Rewards / NFT / Shop are out of scope here. - Strategy C cannot perform on-chain approvals or redeem transactions in this distributable skill. Use Strategy A for
BILL.approve,CTF.setApprovalForAll, andredeem. - Outcome redemption is supported through
redeem.mjs.get-results --only-minesurfaces redeemable positions;redeem.mjs <marketId> --live --strategy AcallsCTF.redeemPositions.
License
MIT — but read the disclaimer at the bottom of the LICENSE file before using.