{"uid":"cap_17zFSInVombQxM2OL2nw9","slug":"chainhilt-polymarket-order-constructor-d2c66353","name":"ChainHilt Polymarket Order Constructor","description":"Construct a prediction-market order; never submits. Needs a `credentialToken` from /predict/polymarket/credentials. Returns `construction` and a signature action the chainhilt wallet signs and POSTs to /predict/polymarket/orders/submit. Review orderSummary and warnings before signing: `estimatedBuilderFee` (ours) and `estimatedVenueFee` (Polymarket's) are pUSD on top of the principal. Errors: 400 invalid input, 401 invalid credentialToken, 422 order refused, 502 venue failure.","url":"https://chainhilt.ai/api/v1/predict/polymarket/orders/construct?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"side":{"enum":["buy","sell"],"type":"string","description":"Buy or sell outcome shares."},"size":{"type":"string","pattern":"^[0-9]+(\\.[0-9]{1,2})?$","description":"Shares, up to 2 decimals; at least the market's `minOrderSize`."},"price":{"type":"string","pattern":"^0\\.[0-9]{1,6}$","description":"Limit price per share in pUSD, strictly between 0 and 1 (e.g. \"0.42\"), a multiple of the market's `tickSize`."},"account":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"The signer EOA. With walletType deposit_wallet, the maker is its derived deposit wallet."},"marketId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,128}$","description":"Polymarket market id from markets/search."},"postOnly":{"type":"boolean","default":false,"description":"Only rest on the book, never cross on arrival. Default false."},"expiresAt":{"type":"string","description":"ISO 8601 expiry: required for GTD, refused for GTC, at least 3 minutes out. Polymarket expires the order 60 seconds earlier."},"orderType":{"enum":["GTC","GTD"],"type":"string","description":"GTC rests until filled or cancelled; GTD expires 60 seconds before `expiresAt`, Polymarket's security threshold."},"walletType":{"enum":["deposit_wallet","eoa"],"type":"string","default":"deposit_wallet","description":"deposit_wallet (default, signatureType 3) or eoa; the venue rejects plain EOA makers unless allowlisted."},"outcomeTokenId":{"type":"string","minLength":1,"description":"The outcome's `tokenId` from the market's `outcomes`; must belong to `marketId`."},"credentialToken":{"type":"string","minLength":1,"description":"Sealed venue credentials for `account` from POST /predict/polymarket/credentials."}}},"responseSchema":{"type":"json","example":{"response":{"errors":[],"actions":[{"data":{"typedData":{"primaryType":"TypedDataSign"},"credentialToken":"pcr1.…","constructionToken":"…"},"type":"signature","chainId":137,"protocol":"polymarket","submitPath":"/predict/polymarket/orders/submit"}],"warnings":[]},"construction":{"wire":{"postOnly":false,"orderType":"GTC","expiration":"0"},"venue":"polymarket","warnings":[],"orderSummary":{"side":"buy","shares":"10","limitPrice":"0.42","estimatedVenueFee":{"asset":"pUSD","amount":"0"},"estimatedBuilderFee":{"asset":"pUSD","amount":"0.021"}},"constructionToken":"…"}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_dqtj7_og4CYTjoL1zEoS3","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Constructs (but does not submit) a Polymarket prediction-market limit order, returning a typed-data signature action for wallet signing and a construction token for submission.","exampleAgentPrompt":"Construct a GTC buy order on Polymarket for market ID 'abc123' on outcome token 'tok456' — 10 shares at a limit price of 0.42 pUSD using my deposit wallet at address 0xAbC...1234, using the credential token I got earlier, and show me the fee breakdown and any warnings before I sign anything.","exampleUseCases":[{"title":"Preview prediction market bet before committing","prompt":"Before I place my bet, can you construct a buy order on Polymarket for 25 shares of outcome token 'tok789' in market 'mkt001' at a limit price of 0.65 using my deposit wallet at 0xDe...9999 and my credential token, so I can review the builder and venue fees first?"},{"title":"Stage a time-limited sell order","prompt":"I want to stage a GTD sell order on Polymarket — market ID 'mkt555', outcome token 'tok222', 5 shares at 0.78 pUSD, using EOA wallet 0xFe...0001 with my credential token, expiring 2025-08-01T18:00:00Z — give me the typed data to sign and warn me if anything looks off."},{"title":"Post-only market maker order construction","prompt":"Construct a post-only GTC buy order on Polymarket for market 'mkt099', outcome 'tok333', 50 shares at 0.31 pUSD using my deposit wallet at 0xAb...4444 and credential token, and make sure it won't cross the book on arrival."}],"resultDescription":"Returns a `construction` object containing the order wire parameters, orderSummary (side, shares, limitPrice, estimatedBuilderFee in pUSD, estimatedVenueFee in pUSD), a constructionToken, and any warnings. Also returns a `response.actions` array with a single `signature` action containing the EIP-712 typedData the wallet must sign and the `submitPath` to POST it to, along with any errors.","failureModes":["400 Bad Request — invalid input parameters such as malformed price, size below minOrderSize, or invalid address format","401 Unauthorized — credentialToken is invalid, expired, or does not match the account","422 Unprocessable Entity — order refused by venue logic (e.g. price not on tick, market inactive, GTD expiry too soon)","502 Bad Gateway — Polymarket venue is unreachable or returned an error upstream"],"whenToPreferThis":"Use this endpoint when you need to construct and review a Polymarket order — including fee estimates and warnings — before committing a wallet signature. It is the required first step before calling /predict/polymarket/orders/submit. Prefer this over direct venue interaction when operating an AI agent that needs to validate order parameters, inspect fees, and present a confirmation step to the user prior to on-chain action.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-16T18:39:04.438Z","isFirstParty":false,"canonicalSlug":"chainhilt-polymarket-order-constructor-d2c66353"}