Polymarket Close Position logo

Catalog action EVM Onchain wallet Gas swap

Close (sell) a Polymarket position by selling shares. Sells all shares by default, or a specified number. Uses market pricing for immediate fills. Ideal for: exiting positions, taking profits, stop-loss automation, portfolio rebalancing.

This action can require a wallet connector, gas, token movement, or an external side effect. Test with simulation or a controlled amount before using it in a live workflow.

At a Glance

FieldValue
Action IDpolymarket-close-position
CategoryEVM Onchain
Connectorwallet
Requires gasYes
Funds movementswap
Tagspolymarket, trading, sell, position, write

Payload Schema

FieldTypeRequiredDescription
tokenIdstringYesThe token ID (condition ID / asset ID) of the position to close. This identifies which outcome shares to sell.
sharesnumberNoNumber of shares to sell. If omitted, sells the entire position.
orderTypestringNoOrder type for the sell order. FAK (Fill And Kill) allows partial fills (default). FOK (Fill Or Kill) requires the entire order to fill or nothing.

Result Schema

FieldTypeRequiredDescription
statusstringYesStatus of the close position operation.
tokenIdstringNoThe token ID that was sold.
sharesSoldnumberNoNumber of shares that were sold.
pricePerSharenumberNoPrice per share received.
totalProceedsnumberNoTotal USDC proceeds from the sale (sharesSold * pricePerShare).
orderIdstringNoThe unique identifier for the sell order.
transactionHashstringNoOn-chain transaction hash if the order settled immediately.
messagestringNoAdditional context about the result.

Examples

json
{ "type": "polymarket-close-position", "payload": { "tokenId": "1" }, "children": [], "connector": { "type": "wallet", "id": "conn_wallet" }}

Payload fields can use workflow expressions such as {{$trigger.body.amount}}, {{$nodes.fetch.result.price}}, and {{$props.asset}} when the value should come from a trigger, prior node, or reusable workflow prop.

Ask a question... ⌘I