Entering an Alphapoly Position
Apps & AutomationExecutes a covered pair trade (target + cover) on Polymarket with estimate, confirmation, and position recording. Use when entering a new position from a detected portfolio opportunity. Also use when the user says "buy", "trade", "open a position", "place an order", "enter", or wants to act on any portfolio opportunity.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/chainstacklabs/polymarket-alpha-bot/blob/HEAD/.claude/skills/alphapoly-enter-position/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/entering-an-alphapoly-position, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Entering an Alphapoly Position
Enter a hedged pair position (target + cover) from a detected alphapoly portfolio.
Prerequisites
- Backend running on
http://localhost:8000 - Wallet unlocked — check
GET /wallet/statusfor"unlocked": true; unlock viaPOST /wallet/unlockwith{"password": "<password>"} - Deposit wallet ready — trades sign as sigtype-3 through a per-user deposit wallet, so
GET /wallet/statusmust show"relayer_set": trueand"deposit_wallet_deployed": true. If not: attach the relayer key (POST /wallet/set-relayer), then deploy (POST /wallet/deploy-deposit-wallet). Without this,buy-pairfails at order placement. - Sufficient pUSD in the deposit wallet — the balance must sit in the deposit wallet (
deposit_wallet_addressfrom status), not the signer EOA; total cost isamount_per_position * 2. The relayer pays gas, so no POL is needed.
7-Step Flow
- List portfolios —
GET /data/portfolios; notepair_id, market IDs, and position sides - Pick a pair — select by
pair_id - Set amount — choose
amount_per_positionin pUSD - Estimate (required) —
POST /trading/buy-pair/estimate; show result to user; stop ifsufficient_balance: false - Confirm — require explicit user approval before proceeding
- Execute —
POST /trading/buy-pair; checksuccess: trueon both legs; surface anywarnings - Record — position is recorded automatically on success; manual
POST /positionsonly needed for imports
For full request/response schemas, see api-reference.md.
Safety Rules
These trades involve real pUSD on Polygon — transactions are irreversible once submitted on-chain. The estimate step is the only chance to catch problems before money moves.
- Always run
/trading/buy-pair/estimatebefore/trading/buy-pair— the estimate reveals actual costs, slippage, and balance issues before committing funds - Never execute without explicit user confirmation — the user needs to see the estimate and agree to the cost
- Never proceed if
sufficient_balance: false— the transaction will fail on-chain and may leave partial state - If
warningsare non-empty after execution, surface them — the user may hold unwanted tokens that need selling viaGET /positions skip_clob_sell: trueonly when the user explicitly requests it