Sells an existing position in a Polymarket market. This endpoint allows users to exit their positions by selling their outcome tokens using market orders (FOK/FAK).
Every request must include expiration and an EIP-712 signatureByEvmEoa over the SellPosition typed data — see the Polymarket Signing Guide.
Proceeds default to the caller’s evmEoa. To deliver them to a different wallet or token, set dstWalletAddress and/or dstToken.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Swaps API Documentation","description":"Swaps is the execution layer for moving value across chains: swaps, bridges, cross-chain contract calls, prediction market trading, and dedicated stableswap liquidity — behind one API. Users transact with any token on any chain; Swaps handles routing, transaction construction, and end-to-end tracking.","colors":{"primary":"#6366F1","light":"#8B5CF6","dark":"#4F46E5"},"logo":{"light":"https://mintcdn.com/swaps/0Y1Q5nsbTP7RcDGa/logo/light.svg?fit=max\u0026auto=format\u0026n=0Y1Q5nsbTP7RcDGa\u0026q=85\u0026s=b4ef18d882340b146df26c61511553d2","dark":"https://mintcdn.com/swaps/0Y1Q5nsbTP7RcDGa/logo/dark.svg?fit=max\u0026auto=format\u0026n=0Y1Q5nsbTP7RcDGa\u0026q=85\u0026s=59d4110408236ccb8bf596629a4999a0"},"favicon":"https://mintcdn.com/swaps/0Y1Q5nsbTP7RcDGa/favicon.svg?fit=max\u0026auto=format\u0026n=0Y1Q5nsbTP7RcDGa\u0026q=85\u0026s=0cd613f8ed2a18d7e151a1c01caa9db5","navbar":{"primary":{"type":"button","label":"Get Started","href":"https://dashboard.moonpay.com/signup"}},"footer":{"socials":{"x":"https://x.com/moonpay","linkedin":"https://www.linkedin.com/company/moonpay"}},"styling":{"latex":false},"navigation":{"global":{"anchors":[]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"swaps","hasAudioNarration":false,"actualSubdomain":"swaps","customDomains":["docs.swaps.xyz"],"gitSource":{"type":"github","owner":"swaps-xyz","repo":"box-monorepo","deployBranch":"main","contentDirectory":"apps/box-docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ad7945dd201333bc5d36e53","collectionId":"986309f2-3617-4b94-a80e-23119a550aa4","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ad7945dd201333bc5d36e53"},"entitlements":{},"buildId":"6ad7945dd201333bc5d36e53","clientVersion":"0.0.4067","searchFilterCounts":[{"language":"default","tag":"Prediction Market Reference","count":24},{"language":"default","tag":"Documentation","count":10},{"language":"default","tag":"Swap API Reference","count":10},{"language":"default","tag":"Trading","count":8},{"language":"default","tag":"Guides","count":6},{"language":"default","tag":"Getting Started","count":6},{"language":"default","tag":"User Positions \u0026 Activity","count":5},{"language":"default","tag":"Market Information","count":4},{"language":"default","tag":"Core","count":4},{"language":"default","tag":"Protocol Reference","count":3}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"prediction-market-reference/sell-position","slug":"/prediction-market-reference/sell-position","pageMetadata":{"title":"Sell Position","description":"Sells an existing position in a Polymarket market. This endpoint allows users to exit their positions by selling their outcome tokens using market orders (FOK/FAK).\n\nEvery request must include `expiration` and an EIP-712 `signatureByEvmEoa` over the `SellPosition` typed data — see the [Polymarket Signing Guide](/prediction-market-reference/polymarket-signing).\n\nProceeds default to the caller's `evmEoa`. To deliver them to a different wallet or token, set `dstWalletAddress` and/or `dstToken`.","deprecated":null,"version":null,"openapi":"/prediction-market-reference/openapi.json post /api/workflows/polymarket/sellPosition","href":"/prediction-market-reference/sell-position","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n a: \"a\",\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsx(_components.p, {\n children: \"Sells an existing position in a Polymarket market. This endpoint allows users to exit their positions by selling their outcome tokens using market orders (FOK/FAK).\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Every request must include \", _jsx(_components.code, {\n children: \"expiration\"\n }), \" and an EIP-712 \", _jsx(_components.code, {\n children: \"signatureByEvmEoa\"\n }), \" over the \", _jsx(_components.code, {\n children: \"SellPosition\"\n }), \" typed data — see the \", _jsx(_components.a, {\n href: \"/prediction-market-reference/polymarket-signing\",\n children: \"Polymarket Signing Guide\"\n }), \".\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Proceeds default to the caller’s \", _jsx(_components.code, {\n children: \"evmEoa\"\n }), \". To deliver them to a different wallet or token, set \", _jsx(_components.code, {\n children: \"dstWalletAddress\"\n }), \" and/or \", _jsx(_components.code, {\n children: \"dstToken\"\n }), \".\"]\n })]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Sell Position","description":"Sells an existing position in a Polymarket market. This endpoint allows users to exit their positions by selling their outcome tokens using market orders (FOK/FAK).\n\nEvery request must include `expiration` and an EIP-712 `signatureByEvmEoa` over the `SellPosition` typed data — see the [Polymarket Signing Guide](/prediction-market-reference/polymarket-signing).\n\nProceeds default to the caller's `evmEoa`. To deliver them to a different wallet or token, set `dstWalletAddress` and/or `dstToken`.","deprecated":null,"version":null,"openapi":"/prediction-market-reference/openapi.json post /api/workflows/polymarket/sellPosition","href":"/prediction-market-reference/sell-position","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"summary":"Sell Position","description":"Sells an existing position in a Polymarket market. This endpoint allows users to exit their positions by selling their outcome tokens using market orders (FOK/FAK).\n\nEvery request must include `expiration` and an EIP-712 `signatureByEvmEoa` over the `SellPosition` typed data — see the [Polymarket Signing Guide](/prediction-market-reference/polymarket-signing).\n\nProceeds default to the caller's `evmEoa`. To deliver them to a different wallet or token, set `dstWalletAddress` and/or `dstToken`.","operationId":"sellPosition","requestBody":"55793ffd-5ec9-4d24-9eef-af9fc649b050","responses":{"200":"544f5190-177c-4992-ae3e-7fe6c8701719","400":"0b608b16-b3a9-4c22-a4f6-73a1b5a21574","401":"a692d94f-7d86-4607-9aba-4139067fe166","500":"e6fea63d-3525-47f0-ad23-d0dd15819cce"},"method":"post","type":"path","servers":["23cfa1ea-51ed-491e-a68d-f63bc5e6ca0b"],"security":["f4caf088-94f7-40ce-966f-ba0b84e77084"],"path":"/api/workflows/polymarket/sellPosition","baseUrlOptions":["https://api-v2.swaps.xyz"],"title":"Sell Position","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["evmEoa","side","tokenID","orderType","tickSize","negRisk","amount","expiration","signatureByEvmEoa"],"properties":{"evmEoa":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"EVM address (wallet address)","isRequired":true,"uniqueKey":"evmEoa","typeLabel":"string"},"side":{"type":"string","enum":["SELL"],"description":"Order side - must be SELL","isRequired":true,"uniqueKey":"side","typeLabel":"enum\u003cstring>"},"tokenID":{"type":"string","description":"Polymarket CLOB token ID of the position to sell","isRequired":true,"uniqueKey":"tokenID","typeLabel":"string"},"orderType":{"type":"string","enum":["FOK","FAK"],"description":"Order type - Fill-Or-Kill (FOK) or Fill-And-Kill (FAK) for market orders","isRequired":true,"uniqueKey":"orderType","typeLabel":"enum\u003cstring>"},"tickSize":{"type":"string","description":"Tick size from the market details (e.g., '0.01')","isRequired":true,"uniqueKey":"tickSize","typeLabel":"string"},"negRisk":{"type":"boolean","description":"Negative risk flag from the market details","isRequired":true,"uniqueKey":"negRisk","typeLabel":"boolean"},"amount":{"type":"number","description":"Amount of tokens to sell (must be a positive number)","isRequired":true,"uniqueKey":"amount","typeLabel":"number"},"expiration":{"type":"integer","description":"Unix timestamp (seconds) when `signatureByEvmEoa` expires. Must be in the future and ≤ 300s ahead.","isRequired":true,"uniqueKey":"expiration","typeLabel":"integer"},"signatureByEvmEoa":{"type":"string","pattern":"^0x[a-fA-F0-9]*$","description":"EIP-712 signature by the EOA over the `SellPosition` typed data. See the [Polymarket Signing Guide](/prediction-market-reference/polymarket-signing).","isRequired":true,"uniqueKey":"signatureByEvmEoa","typeLabel":"string"},"proxyWallet":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Proxy wallet address (optional)","uniqueKey":"proxyWallet","typeLabel":"string"},"slippage":{"type":"number","description":"Slippage tolerance in basis points (optional, defaults to 0)","uniqueKey":"slippage","typeLabel":"number"},"dstToken":{"type":"object","required":["address","chainId"],"description":"Optional destination token. When set, sale proceeds are swapped into this token (address + chainId) before delivery.","properties":{"address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Destination token contract address","isRequired":true,"uniqueKey":"dstToken.address","typeLabel":"string"},"chainId":{"type":"number","description":"Destination chain ID. See the [chain list](/resources/chain-list).","isRequired":true,"uniqueKey":"dstToken.chainId","typeLabel":"number"}},"uniqueKey":"dstToken","typeLabel":"object"},"dstWalletAddress":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Optional wallet that receives the proceeds instead of the caller's `evmEoa`.","uniqueKey":"dstWalletAddress","typeLabel":"string"}},"example":{"evmEoa":"0xB9519a08267d7B259eCA6DbD8F7286B1f176A41f","side":"SELL","tokenID":"90234889617199443673709150877675264662915727532354468551650133547723659310093","orderType":"FAK","tickSize":"0.01","negRisk":true,"amount":2,"slippage":100,"expiration":1735689600,"signatureByEvmEoa":"0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890001b"},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"evmEoa":"0xB9519a08267d7B259eCA6DbD8F7286B1f176A41f","side":"SELL","tokenID":"90234889617199443673709150877675264662915727532354468551650133547723659310093","orderType":"FAK","tickSize":"0.01","negRisk":true,"amount":2,"slippage":100,"expiration":1735689600,"signatureByEvmEoa":"0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890001b"}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"544f5190-177c-4992-ae3e-7fe6c8701719":{"description":"Position sold successfully","content":{"application/json":{"schema":{"type":"object","properties":{"txId":{"type":"string","description":"Transaction ID","uniqueKey":"txId","typeLabel":"string"},"orderResponse":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the sell order was successful","uniqueKey":"orderResponse.success","typeLabel":"boolean"},"errorMsg":{"type":"string","description":"Error message if the order failed (empty string if successful)","uniqueKey":"orderResponse.errorMsg","typeLabel":"string"},"orderID":{"type":"string","description":"Unique order ID","uniqueKey":"orderResponse.orderID","typeLabel":"string"},"transactionsHashes":{"type":"array","items":{"type":"string","uniqueKey":"orderResponse.transactionsHashes.items.[INDEX]","typeLabel":"string"},"description":"Array of transaction hashes","uniqueKey":"orderResponse.transactionsHashes","typeLabel":"string[]"},"status":{"type":"string","description":"Order status (e.g., 'matched')","uniqueKey":"orderResponse.status","typeLabel":"string"},"takingAmount":{"type":"string","description":"Amount of USDC received","uniqueKey":"orderResponse.takingAmount","typeLabel":"string"},"makingAmount":{"type":"string","description":"Amount of tokens sold","uniqueKey":"orderResponse.makingAmount","typeLabel":"string"}},"uniqueKey":"orderResponse","typeLabel":"object"}},"example":{"txId":"0xa66c86a47f4f81caae5d767e2d8a5a7def1a191d24eba5bd49f8767297cfe2e5","orderResponse":{"success":true,"errorMsg":"","orderID":"0xb9826fe87ddf21261eceaf513977cb5ea1ae31ac173210857c879cef936dfa2b","transactionsHashes":["0x39ac6726cf2cfb7814bdb2e04aeeea1d3bde2d1ce7e357f79a404cacb6984f35"],"status":"matched","takingAmount":"1.376","makingAmount":"2"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"txId":"0xa66c86a47f4f81caae5d767e2d8a5a7def1a191d24eba5bd49f8767297cfe2e5","orderResponse":{"success":true,"errorMsg":"","orderID":"0xb9826fe87ddf21261eceaf513977cb5ea1ae31ac173210857c879cef936dfa2b","transactionsHashes":["0x39ac6726cf2cfb7814bdb2e04aeeea1d3bde2d1ce7e357f79a404cacb6984f35"],"status":"matched","takingAmount":"1.376","makingAmount":"2"}}}},"exampleType":"generated"}},"exampleType":"generated"},"0b608b16-b3a9-4c22-a4f6-73a1b5a21574":{"description":"Bad request due to missing or invalid parameters","content":{"application/json":{"schema":{"type":"object","required":["success","error"],"properties":{"success":{"type":"boolean","description":"Always false for error responses","enum":[false],"example":false,"isRequired":true,"uniqueKey":"success","typeLabel":"enum\u003cboolean>"},"error":{"type":"object","required":["code","name","message","title","statusCode","timestamp"],"properties":{"code":{"type":"string","description":"Error type code for programmatic handling","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"name":{"type":"string","description":"Error class name","isRequired":true,"uniqueKey":"error.name","typeLabel":"string"},"message":{"type":"string","description":"Detailed error message","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"title":{"type":"string","description":"Short, user-friendly error title","isRequired":true,"uniqueKey":"error.title","typeLabel":"string"},"statusCode":{"type":"integer","description":"HTTP status code","isRequired":true,"uniqueKey":"error.statusCode","typeLabel":"integer"},"timestamp":{"type":"string","description":"ISO 8601 timestamp when the error occurred","isRequired":true,"uniqueKey":"error.timestamp","typeLabel":"string"},"details":{"type":"object","description":"Additional error details","additionalProperties":true,"uniqueKey":"error.details","typeLabel":"object"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":false,"error":{"code":"\u003cstring>","name":"\u003cstring>","message":"\u003cstring>","title":"\u003cstring>","statusCode":123,"timestamp":"\u003cstring>","details":{}}}}},"exampleType":"generated"}},"exampleType":"generated"},"a692d94f-7d86-4607-9aba-4139067fe166":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"type":"object","required":["success","error"],"properties":{"success":{"type":"boolean","description":"Always false for error responses","enum":[false],"example":false,"isRequired":true,"uniqueKey":"success","typeLabel":"enum\u003cboolean>"},"error":{"type":"object","required":["code","name","message","title","statusCode","timestamp"],"properties":{"code":{"type":"string","description":"Error type code for programmatic handling","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"name":{"type":"string","description":"Error class name","isRequired":true,"uniqueKey":"error.name","typeLabel":"string"},"message":{"type":"string","description":"Detailed error message","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"title":{"type":"string","description":"Short, user-friendly error title","isRequired":true,"uniqueKey":"error.title","typeLabel":"string"},"statusCode":{"type":"integer","description":"HTTP status code","isRequired":true,"uniqueKey":"error.statusCode","typeLabel":"integer"},"timestamp":{"type":"string","description":"ISO 8601 timestamp when the error occurred","isRequired":true,"uniqueKey":"error.timestamp","typeLabel":"string"},"details":{"type":"object","description":"Additional error details","additionalProperties":true,"uniqueKey":"error.details","typeLabel":"object"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":false,"error":{"code":"\u003cstring>","name":"\u003cstring>","message":"\u003cstring>","title":"\u003cstring>","statusCode":123,"timestamp":"\u003cstring>","details":{}}}}},"exampleType":"generated"}},"exampleType":"generated"},"e6fea63d-3525-47f0-ad23-d0dd15819cce":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["success","error"],"properties":{"success":{"type":"boolean","description":"Always false for error responses","enum":[false],"example":false,"isRequired":true,"uniqueKey":"success","typeLabel":"enum\u003cboolean>"},"error":{"type":"object","required":["code","name","message","title","statusCode","timestamp"],"properties":{"code":{"type":"string","description":"Error type code for programmatic handling","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"name":{"type":"string","description":"Error class name","isRequired":true,"uniqueKey":"error.name","typeLabel":"string"},"message":{"type":"string","description":"Detailed error message","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"title":{"type":"string","description":"Short, user-friendly error title","isRequired":true,"uniqueKey":"error.title","typeLabel":"string"},"statusCode":{"type":"integer","description":"HTTP status code","isRequired":true,"uniqueKey":"error.statusCode","typeLabel":"integer"},"timestamp":{"type":"string","description":"ISO 8601 timestamp when the error occurred","isRequired":true,"uniqueKey":"error.timestamp","typeLabel":"string"},"details":{"type":"object","description":"Additional error details","additionalProperties":true,"uniqueKey":"error.details","typeLabel":"object"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":false,"error":{"code":"\u003cstring>","name":"\u003cstring>","message":"\u003cstring>","title":"\u003cstring>","statusCode":123,"timestamp":"\u003cstring>","details":{}}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"f4caf088-94f7-40ce-966f-ba0b84e77084":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"API key for authentication. Contact Swaps.xyz to obtain an API key.","scopes":[]}}},"servers":{"23cfa1ea-51ed-491e-a68d-f63bc5e6ca0b":{"url":"https://api-v2.swaps.xyz","description":"Production server"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"x-api-key","description":"API key for authentication. Contact Swaps.xyz to obtain an API key.","scopes":[]},"schema":{"title":"x-api-key","type":"string","description":"API key for authentication. Contact Swaps.xyz to obtain an API key.","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"ApiKeyAuth","name":"x-api-key"}],"title":"ApiKeyAuth"}]},"originalFileLocation":"prediction-market-reference/openapi.json"},"subdomain":"swaps","siteName":"Swaps API Documentation","title":"Sell Position - Swaps API Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-08-06T23:49:39.491Z","originalFileLocation":"prediction-market-reference/sell-position.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Sells an existing position in a Polymarket market. This endpoint allows users to exit their positions by selling their outcome tokens using market orders (FOK/FAK). Every request must include expiration and an EIP-712 signatureByEvmEoa over the SellPosition typed data — see the Polymarket Signing Guide. Proceeds default to the caller\u0026#x27;s evmEoa. To deliver them to a different wallet or token, set dstWalletAddress and/or dstToken.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Swaps API Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/swaps/GMGSy86BYr2YqEGa/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/swaps/GMGSy86BYr2YqEGa/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/swaps/GMGSy86BYr2YqEGa/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/swaps/GMGSy86BYr2YqEGa/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/swaps/GMGSy86BYr2YqEGa/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/swaps/GMGSy86BYr2YqEGa/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/swaps/GMGSy86BYr2YqEGa/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/swaps/GMGSy86BYr2YqEGa/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/swaps/GMGSy86BYr2YqEGa/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Sell Position - Swaps API Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Sells an existing position in a Polymarket market. This endpoint allows users to exit their positions by selling their outcome tokens using market orders (FOK/FAK). Every request must include expiration and an EIP-712 signatureByEvmEoa over the SellPosition typed data — see the Polymarket Signing Guide. Proceeds default to the caller\u0026#x27;s evmEoa. To deliver them to a different wallet or token, set dstWalletAddress and/or dstToken.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Swaps API Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.swaps.xyz/prediction-market-reference/sell-position\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://swaps.mintlify.app/_mintlify/api/og/v2?division=Trading\u0026amp;title=Sell+Position\u0026amp;description=Sells+an+existing+position+in+a+Polymarket+market.+This+endpoint+allows+users+to+exit+their+positions+by+selling+their+outcome+tokens+using+market+orders+%28FOK%2FF\u0026amp;theme=e402633778683274be5dc99a\u0026amp;signature=4d2a217f7c2cfbaefb7ce57de4f125e6169d203513a55462e19a99662b436994\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Sell Position - Swaps API Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Sells an existing position in a Polymarket market. This endpoint allows users to exit their positions by selling their outcome tokens using market orders (FOK/FAK). Every request must include expiration and an EIP-712 signatureByEvmEoa over the SellPosition typed data — see the Polymarket Signing Guide. Proceeds default to the caller\u0026#x27;s evmEoa. To deliver them to a different wallet or token, set dstWalletAddress and/or dstToken.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://swaps.mintlify.app/_mintlify/api/og/v2?division=Trading\u0026amp;title=Sell+Position\u0026amp;description=Sells+an+existing+position+in+a+Polymarket+market.+This+endpoint+allows+users+to+exit+their+positions+by+selling+their+outcome+tokens+using+market+orders+%28FOK%2FF\u0026amp;theme=e402633778683274be5dc99a\u0026amp;signature=4d2a217f7c2cfbaefb7ce57de4f125e6169d203513a55462e19a99662b436994\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/swaps/GMGSy86BYr2YqEGa/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Swaps API Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#6366F1\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.swaps.xyz/prediction-market-reference/sell-position\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/prediction-market-reference/sell-position.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.swaps.xyz/#organization\",\"name\":\"Swaps API Documentation\",\"url\":\"https://docs.swaps.xyz\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/swaps/0Y1Q5nsbTP7RcDGa/logo/light.svg?fit=max\u0026auto=format\u0026n=0Y1Q5nsbTP7RcDGa\u0026q=85\u0026s=b4ef18d882340b146df26c61511553d2\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.swaps.xyz#website\",\"name\":\"Swaps API Documentation\",\"url\":\"https://docs.swaps.xyz\",\"publisher\":{\"@id\":\"https://docs.swaps.xyz/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.swaps.xyz/prediction-market-reference/sell-position#webpage\",\"url\":\"https://docs.swaps.xyz/prediction-market-reference/sell-position\",\"name\":\"Sell Position\",\"description\":\"Sells an existing position in a Polymarket market. This endpoint allows users to exit their positions by selling their outcome tokens using market orders (FOK/FAK). Every request must include expiration and an EIP-712 signatureByEvmEoa over the SellPosition typed data — see the Polymarket Signing Guide. Proceeds default to the caller's evmEoa. To deliver them to a different wallet or token, set dstWalletAddress and/or dstToken.\",\"dateModified\":\"2026-08-06T23:49:39.491Z\",\"isPartOf\":{\"@id\":\"https://docs.swaps.xyz#website\"},\"breadcrumb\":{\"@id\":\"https://docs.swaps.xyz/prediction-market-reference/sell-position#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.swaps.xyz/prediction-market-reference/sell-position#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Trading\",\"item\":\"https://docs.swaps.xyz/prediction-market-reference/place-order-chain-abstracted\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Sell Position\",\"item\":\"https://docs.swaps.xyz/prediction-market-reference/sell-position\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.swaps.xyz/prediction-market-reference/sell-position#apireference\",\"headline\":\"Sell Position\",\"name\":\"Sell Position\",\"description\":\"Sells an existing position in a Polymarket market. This endpoint allows users to exit their positions by selling their outcome tokens using market orders (FOK/FAK). Every request must include expiration and an EIP-712 signatureByEvmEoa over the SellPosition typed data — see the Polymarket Signing Guide. Proceeds default to the caller's evmEoa. To deliver them to a different wallet or token, set dstWalletAddress and/or dstToken.\",\"url\":\"https://docs.swaps.xyz/prediction-market-reference/sell-position\",\"mainEntityOfPage\":{\"@id\":\"https://docs.swaps.xyz/prediction-market-reference/sell-position#webpage\"},\"dateModified\":\"2026-08-06T23:49:39.491Z\",\"publisher\":{\"@id\":\"https://docs.swaps.xyz/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.swaps.xyz#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Swaps API Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Swaps API Documentation","nav":{"global":{"anchors":[]},"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":""}]},{"tab":"Swap API Reference","pages":[{"title":"Swap API Reference","href":"/swap-api-reference/overview"}]},{"tab":"Prediction Market Reference","groups":[{"group":"Getting Started","pages":[{"title":"Overview","href":"/prediction-market-reference/overview"},{"title":"Integration Patterns","href":"/prediction-market-reference/integration-patterns"},{"title":"Transaction Lifecycle","href":"/prediction-market-reference/transaction-lifecycle"},{"title":"Polymarket Signing Guide","href":"/prediction-market-reference/polymarket-signing"}]},{"group":"Trading","pages":[{"title":"Place Order (Chain Abstracted)","href":"/prediction-market-reference/place-order-chain-abstracted"},{"title":"Create or Fetch User","deprecated":null,"version":null,"openapi":"/prediction-market-reference/openapi.json post /api/workflows/polymarket/createOrFetchPolymarketUser","href":"/prediction-market-reference/create-or-fetch-user"},{"title":"Place Order","description":"Places a market order (BUY or SELL) directly against the Polymarket CLOB on behalf of the user, using their pre-funded proxy wallet.\n\nThis endpoint always requires an EIP-712 `signatureByEvmEoa` produced by the user's EOA — see the [Polymarket Signing Guide](/prediction-market-reference/polymarket-signing). The endpoint submits the order synchronously and returns `{ txId, orderResponse }` so callers can poll workflow status.","deprecated":null,"version":null,"openapi":"/prediction-market-reference/openapi.json post /api/workflows/polymarket/placeOrder","href":"/prediction-market-reference/place-order"},{"title":"Sell Position","deprecated":null,"version":null,"openapi":"/prediction-market-reference/openapi.json post /api/workflows/polymarket/sellPosition","href":"/prediction-market-reference/sell-position"},{"title":"Redeem Position","description":"Redeems position from a resolved Polymarket market. For positions with a current value > 0, this endpoint allows users to claim their winnings from a specific market condition. For losing positions with a current value = 0, this endpoint allows users to burn their position tokens to clean up their account. \n Endpoint awaits successful execution of the redemption transaction before returning the transaction hash.\n\nEvery request must include `expiration` and an EIP-712 `signatureByEvmEoa` over the `RedeemPosition` typed data — see the [Polymarket Signing Guide](/prediction-market-reference/polymarket-signing).\n\nProceeds default to the caller's `evmEoa`. To deliver them to a different wallet or token, set `dstWalletAddress` and/or `dstToken`.","deprecated":null,"version":null,"openapi":"/prediction-market-reference/openapi.json post /api/workflows/polymarket/redeemPosition","href":"/prediction-market-reference/redeem-position"},{"title":"Merge Position","deprecated":null,"version":null,"openapi":"/prediction-market-reference/openapi.json post /api/workflows/polymarket/mergePositions","href":"/prediction-market-reference/merge-position"},{"title":"Withdraw","deprecated":null,"version":null,"openapi":"/prediction-market-reference/openapi.json post /api/workflows/polymarket/withdraw","href":"/prediction-market-reference/withdraw"},{"title":"Get Workflow Status","deprecated":null,"version":null,"openapi":"/prediction-market-reference/openapi.json get /api/workflows/getStatus","href":"/prediction-market-reference/get-workflow-status"}]},{"group":"Market Discovery","pages":[{"title":"Search Markets","deprecated":null,"version":null,"openapi":"/prediction-market-reference/openapi.json get /api/workflows/polymarket/search","href":"/prediction-market-reference/search-markets"},{"title":"Get Trending Markets","deprecated":null,"version":null,"openapi":"/prediction-market-reference/openapi.json get /api/workflows/polymarket/getTrendingMarkets","href":"/prediction-market-reference/get-trending-markets"},{"title":"Get Tags","deprecated":null,"version":null,"openapi":"/prediction-market-reference/openapi.json get /api/workflows/polymarket/getTags","href":"/prediction-market-reference/get-tags"}]},{"group":"Market Information","pages":[{"title":"Get Event","deprecated":null,"version":null,"openapi":"/prediction-market-reference/openapi.json get /api/workflows/polymarket/getEvent","href":"/prediction-market-reference/get-event"},{"title":"Get Markets","deprecated":null,"version":null,"openapi":"/prediction-market-reference/openapi.json get /api/workflows/polymarket/getMarkets","href":"/prediction-market-reference/get-markets"},{"title":"Get Market Price","deprecated":null,"version":null,"openapi":"/prediction-market-reference/openapi.json get /api/workflows/polymarket/getMarketPrice","href":"/prediction-market-reference/get-market-price"},{"title":"Get Price History","deprecated":null,"version":null,"openapi":"/prediction-market-reference/openapi.json get /api/workflows/polymarket/getPriceHistory","href":"/prediction-market-reference/get-price-history"}]},{"group":"User Positions \u0026 Activity","pages":[{"title":"Get Current Positions","deprecated":null,"version":null,"openapi":"/prediction-market-reference/openapi.json get /api/workflows/polymarket/getCurrentPositions","href":"/prediction-market-reference/get-current-positions"},{"title":"Get Closed Positions","deprecated":null,"version":null,"openapi":"/prediction-market-reference/openapi.json get /api/workflows/polymarket/getClosedPositions","href":"/prediction-market-reference/get-closed-positions"},{"title":"Get Trades","deprecated":null,"version":null,"openapi":"/prediction-market-reference/openapi.json get /api/workflows/polymarket/getTrades","href":"/prediction-market-reference/get-trades"},{"title":"Get Activity","deprecated":null,"version":null,"openapi":"/prediction-market-reference/openapi.json get /api/workflows/polymarket/getActivity","href":"/prediction-market-reference/get-activity"},{"title":"Get Profit and Loss","deprecated":null,"version":null,"openapi":"/prediction-market-reference/openapi.json get /api/workflows/polymarket/getPnL","href":"/prediction-market-reference/get-profit-and-loss"}]}]},{"tab":"Protocol Reference","pages":[{"title":"Protocol Reference","href":"/protocol-reference/overview"}]}]},"basePath":"","title":"Sell Position - Swaps API Documentation","buildId":"dpl_9VVk5y1P8k1ATeJguVngy9Q3cmbD","deploymentId":"dpl_9VVk5y1P8k1ATeJguVngy9Q3cmbD","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-DX1Meug0.js","utils-B_OMIQVC.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-ChxhRPMa.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-CuKvD8Iv.js","snippetPresets-C5d7p2hp.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-CfHcE8m4.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-C1zZV314.js","shallow-CmQhqCJn.js","getApiPlaygroundDisplay-YRo9s1O7.js","CodeSnippet-RN1MTdfk.js","CodeSnippets-DKLPHxJA.js","Page-BAvA99GL.js","getPastedJson-bz0M41mU.js","icon-CsmhpPrv.js","MethodPill-CNGsVE77.js","DuplicateIcon-DilfU_Z2.js","createIcon-BdsYzQck.js","DynamicMarkdown-CbqEDjbV.js","SectionHeading-O6hXpFCN.js","axios-vUo_bRtp.js","Markdown-nKm-uidQ.js","clsx-ClVdStUn.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-CIQkMg3R.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-ImrFS4Fy.js"]}