Conversation
feat: --round-up flag for buy (snaps divisibility-constrained amounts to minimum) feat: --post-only flag for buy/sell (maker-only, qualifies for maker rebates) feat: --expires <unix_ts> flag for buy/sell (GTD orders with auto-cancel) fix: neg_risk buy now approves both NEG_RISK_CTF_EXCHANGE and NEG_RISK_ADAPTER fix: get-market best_bid/best_ask now returns best price (was returning worst) fix: GTD --expires minimum validation tightened to 90s to match CLOB threshold fix(SKILL): agent flow for small-amount errors collapsed into single user prompt; min_order_size field must never be used to auto-escalate order amounts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
8ff3223 to
41e16e2
Compare
🔨 Phase 2: Build Verification — ✅ PASSED
Build succeeded. Compiled artifact uploaded as workflow artifact. Source integrity: commit SHA `` is the content fingerprint. |
Phase 4: Summary + Pre-flight for
|
…and GTD suggestions - Decision tree matching user intent to GTC/FOK/POST_ONLY/GTD - Agent prompted to suggest --post-only on resting limits (below spread) - Agent prompted to suggest --expires when user expresses time constraints - Combined POST_ONLY+GTD guidance for cost-conscious timed orders - Expanded Command Routing Table with all 4 order type entry points Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
📋 Phase 3: AI Code Review Report — Score: 87/100
1. Plugin Overview
Summary: This plugin enables trading on Polymarket prediction markets via the Polygon blockchain. Users can browse markets, buy/sell YES/NO outcome tokens using USDC.e, check positions, and manage orders. It integrates with the onchainos wallet for EIP-712 signing and on-chain approvals. Target Users: DeFi traders interested in prediction markets who want to interact with Polymarket through an AI agent using their onchainos wallet. 2. Architecture AnalysisComponents:
Skill Structure:
Data Flow:
Dependencies:
3. Auto-Detected Permissionsonchainos Commands Used
Wallet Operations
External APIs / URLs
Chains Operated On
Overall Permission SummaryThis plugin has high financial risk exposure. It can: (1) sign EIP-712 messages via the onchainos wallet, (2) submit on-chain contract calls with 4. onchainos API ComplianceDoes this plugin use onchainos CLI for all on-chain write operations?Yes — all on-chain writes go through On-Chain Write Operations (MUST use onchainos)
Data Queries (allowed to use external sources)
External APIs / Libraries Detected
Verdict: ✅ Fully CompliantAll on-chain write operations use onchainos CLI. External API calls are limited to read-only data queries and authenticated order submission (which is off-chain CLOB interaction, not on-chain broadcasting). 5. Security AssessmentStatic Rule Scan (C01-C09, H01-H09, M01-M08, L01-L02)
LLM Judge Analysis (L-PINJ, L-MALI, L-MEMA, L-IINJ, L-AEXE, L-FINA, L-FISO)
Toxic Flow Detection (TF001-TF006)
No toxic flows detected. Prompt Injection Scan
Result: ✅ Clean Dangerous Operations CheckThe plugin involves:
Result: Data Exfiltration Risk
Result: ✅ No Risk Overall Security Rating: 🟡 Medium RiskThe plugin handles real money (USDC.e on Polygon) and uses 6. Source Code Security (if source code is included)Language & Build Config
Dependency AnalysisKey dependencies (all from crates.io):
No suspicious, unmaintained, or vulnerable dependencies detected. Code Safety Audit
Does SKILL.md accurately describe what the source code does?Yes — the SKILL.md accurately describes:
Verdict: ✅ Source Safe7. Code ReviewQuality Score: 87/100
Strengths
Issues Found
8. Recommendations
9. Reviewer SummaryOne-line verdict: Well-engineered prediction market trading plugin with proper onchainos integration, good security documentation, and clean source code — the main concern is the use of Merge recommendation: The following items should be noted:
Generated by Claude AI via Anthropic API — review the full report before approving. |
✅ Phase 1: Structure Validation — PASSED→ Proceeding to Phase 2: Build Verification |
- Remove unused `confirm` param from sell::run() and its call site in main.rs (was declared but never checked — dead code from a planned but unimplemented low-price confirmation gate) - Add sell --dry-run flag to SKILL.md command signature and flags table - Add credential rotation guidance to Credential Setup section (delete ~/.config/polymarket/creds.json to force re-derivation) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
buy --round-up: snaps divisibility-constrained amounts to the nearest valid minimum instead of erroring; output includesrounded_up: trueand bothusdc_requested/usdc_amountfieldsbuy/sell --post-only: maker-only flag that rejects orders which would immediately cross the spread; qualifies for Polymarket's maker rebates program (20–50% of fees returned daily)buy/sell --expires <unix_ts>: GTD (Good Till Date) orders that auto-cancel at the given timestamp; automatically setsorder_type: GTDneg_riskbuy: now approves bothNEG_RISK_CTF_EXCHANGEandNEG_RISK_ADAPTER— the CLOB checks allowance on both contracts for multi-outcome markets; previously onlyNEG_RISK_CTF_EXCHANGEwas approved, causing "not enough allowance" rejectionsget-marketbest_bid/best_ask: was returning the worst price in the book (.first()on ascending bids / descending asks); now correctly returns the best price (.last())--expiresvalidation: tightened from 60 s to 90 s to match the CLOB's actual "now + 1 min 30 s" security thresholdmin_order_sizeAPI field must never be used to auto-escalate order amountsTest plan
will-rory-mcilroy-win-the-2026-masters-tournament→status: livestatus: live, accepted as maker-onlystatus: live; confirmed auto-cancelled after expiry ("already canceled or matched")neg_riskbuy on Masters tournament market (neg_risk: true) — both contracts approved, order placed successfullyget-marketon Masters market:best_bid: 0.35,best_ask: 0.36(correct tight spread); previously showed far end of book--round-upon indivisible amount: snaps to minimum, logs rounded amount to stderr🤖 Generated with Claude Code