Polymarket Aionmarket Trader
Use this skill when the user wants to place, inspect, or prepare a Polymarket trade through Aionmarket. Prefer the documented Python SDK when possible, and fall back to raw REST only when the SDK does not cover the requested step.
When To Use
- User wants to trade on Polymarket through Aionmarket.
- User asks to register or verify Polymarket wallet credentials.
- User wants a market order or limit order submitted to Aionmarket.
- User has an Aionmarket API key and Polymarket CLOB credentials.
- User can provide a wallet private key for local EIP712 signing, or already has a signed order object.
- User wants the workflow expressed with SDK client methods instead of raw HTTP requests.
Secret Handling Rules
- Ask for secrets only when they are required for the next concrete step.
- Treat Aionmarket API keys, Polymarket apiSecret, apiPassphrase, and wallet private keys as transient secrets.
- Never write secrets into repository files, examples, commits, logs, or markdown artifacts.
- If the user does not want to share a wallet private key, ask for a pre-signed EIP712 order object instead.
- If credentials are missing, stop at the preparation stage and tell the user exactly what is still needed.
Required Inputs
Collect the following before submitting a live Polymarket order:
- Aionmarket API key, or permission to register a new agent and return the one-time API key.
- Wallet address for the Polymarket account.
- Polymarket CLOB API key, API secret, and API passphrase for wallet credential registration.
- Either the wallet private key for local signing, or a fully signed EIP712 order payload.
- Trade intent: marketConditionId, marketQuestion, outcome, orderSize, price, order type, and reasoning.
Use the intake checklist in trade-request-template.md.
Procedure
- Confirm whether the user wants simulation only or live Polymarket trading.
- If the user wants SDK-first guidance, initialize
AionMarketClient(api_key=..., base_url="https://pm-t1.bxingupdate.com/bvapi"). - If no Aionmarket API key exists, register an agent with
POST /agents/registerand tell the user to save the returned API key immediately. - Verify connectivity with
GET /agents/meor the SDK's profile check path before doing anything stateful. - If live trading is requested, prefer the SDK wallet flow:
client.check_wallet_credentials(wallet)client.register_wallet_credentials(wallet_address=..., api_key=..., api_secret=..., api_passphrase=...)Use raw REST only if the SDK is unavailable.
- Search or confirm the target market, then inspect market context before execution. For periodic discovery or monitoring, prefer
client.get_briefing(venue="polymarket", include_markets=True, user=wallet). - If the user gave a wallet private key, sign the Polymarket order locally and never persist the key. If the user did not, require a pre-signed
orderobject. - Validate trade fields before submit:
venuedefaults topolymarketoutcomemust beYESorNOorderSizeandpricemust be explicitwalletAddressshould match the registered wallet- for immediate BUY orders with
FAKorFOK, precision rules apply to micro-unit amounts
- Submit the trade through the available execution path. If no SDK submit helper is confirmed for the current environment, call
POST /markets/tradewith the signed order payload and includereasoning,source, andskillSlugwhen available. - After submission, offer to inspect open orders, current positions, or cancel stale orders.
Documented SDK Methods
The Aionmarket docs currently show these Python SDK methods explicitly:
AionMarketClient(api_key=..., base_url=...)client.get_briefing(venue="polymarket", include_markets=True, user=wallet)client.check_wallet_credentials(wallet)client.register_wallet_credentials(wallet_address=..., api_key=..., api_secret=..., api_passphrase=...)
Treat any unconfirmed helper names as unknown until the docs or installed SDK prove they exist. If a needed SDK helper is not documented, use the corresponding REST endpoint instead of inventing a client method.
Execution Notes
- Aionmarket expects a signed Polymarket order payload inside the
orderfield. Wallet credential registration alone does not sign orders. POST /markets/tradesupports both limit and market-style execution throughisLimitOrderandorderType.- The docs explicitly demonstrate SDK coverage for briefing and wallet credential management, but they do not explicitly show a Polymarket trade submit helper name in the pages reviewed here.
- For discovery or risk review, prefer briefing and market context before placing orders.
- If the API returns
401, re-check the Bearer token. If it returns403, verify claim status, wallet registration, and guardrails. If it returns429, retry with backoff.