Learn how to manage outcome-token inventory from creation through redemption.
Manage positions outside the order book by splitting collateral into complete
sets of outcome tokens, merging balanced tokens back into collateral, or
redeeming winning tokens after resolution.Choose an operation based on how you want to change your position:
Operation
Use it when
Split
You need to convert collateral into a complete set of outcome tokens.
Merge
You hold balanced outcome tokens and want to convert them back to collateral.
Redeem
A market has resolved and you want to claim collateral for winning positions.
Choose the integration surface you will use to submit position operations.
TypeScript
Python
API
Solidity
The examples on this page assume you have a SecureClient configured with
either a Relayer API key or a Builder API key.
The synchronous SecureClient provides the same methods and supports both
API key types.See Wallets and
Authentication for the
complete wallet setup and Relayer authorization flow.
Use a deployed Deposit Wallet and its owner signer to submit position calls through the Relayer. Complete wallet setup and Relayer authorization, then set the request credentials:
Replace <position_target_address> with the selected address in both the signed call list and submission. For CTF, choose the adapter using the market’s negRisk value. A market whose version is "v2" uses the Router.
Call the position contract directly from the address holding the collateral or outcome tokens. Select the target for the market’s position system:
Position system
Market type
Target contract
Address
Polymarket V2
Standard or negative risk
Router
0x12121212006e4CD160D18e3f00711DA5c3372600
CTF
Standard
CtfCollateralAdapter
0xAdA100Db00Ca00073811820692005400218FcE1f
CTF
Negative risk
NegRiskCtfCollateralAdapter
0xadA2005600Dec949baf300f4C6120000bDB6eAab
Use these token contracts when granting approvals:
amount is denominated in pUSD base units, so 1_000_000n splits 1 pUSD
into 1 YES token and 1 NO token. wait() returns a TransactionOutcome
after the transaction settles.
Call split_position() on an AsyncSecureClient. The synchronous
SecureClient provides the same method. Both clients identify the position
system from the condition ID and select the correct route.
amount is denominated in pUSD base units, so 1_000_000 splits 1 pUSD
into 1 YES token and 1 NO token. wait() returns a TransactionOutcome
after the transaction settles.
Encode the split call, then sign and submit it as a Deposit Wallet batch.
1
Build the Position Call
Use the target from the API table in the setup above and the arguments for your position system:
Argument
Polymarket V2
CTF
conditionId
31-byte Polymarket V2 condition ID
Original 32-byte CTF condition ID
collateralToken
—
pUSD: 0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB
parentCollectionId
—
32 zero bytes
partition
—
[1, 2]
amount
Amount in six-decimal base units
Amount in six-decimal base units
ABI-encode the function for your market’s protocol using the arguments above:
function split(bytes31 conditionId, uint256 amount);
Merging converts a complete set of outcome tokens back into pUSD. Every 1 YES
token and 1 NO token returns 1 pUSD.
100 YES tokens + 100 NO tokens → 100 pUSD
Before merging, ensure you have:
Equal amounts of YES and NO tokens.
Approved the position call target for the market’s position system to
transfer the wallet’s outcome tokens.
TypeScript
Python
API
Solidity
Call mergePositions() on a SecureClient. The client identifies the
position system, selects the correct route, and checks the
wallet’s mergeable balance.
Pass a base-unit bigint to merge a specific amount. "max" merges the
smaller of the wallet’s YES and NO balances. wait() returns a
TransactionOutcome after the transaction settles.
Call merge_positions() on an AsyncSecureClient. The synchronous
SecureClient provides the same method. Both clients identify the
position system, select the correct route, and check the wallet’s
mergeable balance.
Pass a base-unit int to merge a specific amount. "max" merges the
smaller of the wallet’s YES and NO balances. wait() returns a
TransactionOutcome after the transaction settles.
Encode the merge call, then sign and submit it as a Deposit Wallet batch.
1
Build the Position Call
Use the target from the API table in the setup above and the arguments for your position system:
Argument
Polymarket V2
CTF
conditionId
31-byte Polymarket V2 condition ID
Original 32-byte CTF condition ID
collateralToken
—
pUSD: 0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB
parentCollectionId
—
32 zero bytes
partition
—
[1, 2]
amount
Amount in six-decimal base units
Amount in six-decimal base units
ABI-encode the function for your market’s protocol using the arguments above:
function merge(bytes31 conditionId, uint256 amount);
Redemption has no amount parameter: it redeems the wallet’s balances for
both outcomes. wait() returns a TransactionOutcome after the transaction
settles.
Call redeem_positions() on an AsyncSecureClient. The synchronous
SecureClient provides the same method. Both clients use the condition ID
to select the correct route for the market’s position system.
Redemption has no amount parameter: it redeems the wallet’s balances for
both outcomes. wait() returns a TransactionOutcome after the transaction
settles.
Encode the redeem call, then sign and submit it as a Deposit Wallet batch.
1
Build the Position Call
Use the target from the API table in the setup above and the arguments for your position system:
Argument
Polymarket V2
CTF
conditionId
31-byte Polymarket V2 condition ID
Original 32-byte CTF condition ID
collateralToken
—
pUSD: 0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB
parentCollectionId
—
32 zero bytes
indexSets
—
[1, 2] to redeem both outcomes
outcomeIndex
0 for YES or 1 for NO
—
amount
Amount to redeem for the selected outcome, in base units
Redeems the selected outcome balances in full
ABI-encode the function for your market’s protocol using the arguments above:
function redeem(bytes31 conditionId, uint256 outcomeIndex, uint256 amount);
function redeemPositions( address collateralToken, bytes32 parentCollectionId, bytes32 conditionId, uint256[] indexSets);
Build the call list for the outcomes you want to redeem. Polymarket Protocol V2 uses one call per outcome. CTF can redeem both in one call. Include the calls in the same wallet batch.
encodeBytes31 writes exactly 31 big-endian bytes, preserving leading zeros. For a YES/NO position, the outcome index is 0 or 1.
2
Submit the Batch
Include the selected call list in the signed Deposit Wallet batch and submit it with the Relayer API key. This example redeems both Polymarket Protocol V2 outcomes:
See Execute Gasless Transactions for nonce creation, wallet-batch signing, and confirmation. Wait for STATE_CONFIRMED before using the new balances.
Approve the selected position contract, then execute the redeem from the same address.
1
Approve Outcome Transfers
Call setApprovalForAll on the outcome-token ledger from the address holding the positions:
function setApprovalForAll(address operator, bool approved) external;
Position system
Token ledger
Operator
Approved
Polymarket V2
PositionManager
Router
true
CTF
Conditional Tokens
Selected collateral adapter
true
Use the addresses in the Solidity setup above. An existing operator approval is sufficient.
2
Redeem the Positions
Use the approved target from the Solidity table in the setup above. Call the function for your position system:
function redeem(bytes31 conditionId, uint256 outcomeIndex, uint256 amount);
function redeemPositions( address collateralToken, bytes32 parentCollectionId, bytes32 conditionId, uint256[] indexSets);
Argument
Polymarket V2
CTF
conditionId
31-byte Polymarket V2 condition ID
Original 32-byte CTF condition ID
collateralToken
—
pUSD: 0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB
parentCollectionId
—
32 zero bytes
indexSets
—
[1, 2] to redeem both outcomes
outcomeIndex
0 for YES or 1 for NO
—
amount
Amount to redeem for the selected outcome, in base units
Redeems the selected outcome balances in full
Polymarket Protocol V2 redeems one outcome and an explicit amount per call. Both calls can execute in one transaction. CTF redeems both selected outcome balances in one call.
Derive V2 Inputs From a Position ID
If you start with a Polymarket Protocol V2 Position ID, derive the condition and outcome locally, retaining all 256 bits:
encodeBytes31 writes exactly 31 big-endian bytes, preserving leading zeros. For a YES/NO position, the outcome index is 0 or 1.
Was this page helpful?
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"Polymarket Documentation","colors":{"primary":"#165DFC","light":"#165DFC","dark":"#165DFC"},"logo":{"light":"https://mintcdn.com/polymarket-292d1b1b/ZibMe6Tli_amZald/logo/light.svg?fit=max\u0026auto=format\u0026n=ZibMe6Tli_amZald\u0026q=85\u0026s=9f9bd559f02181495794661ef6426c0f","dark":"https://mintcdn.com/polymarket-292d1b1b/ZibMe6Tli_amZald/logo/dark.svg?fit=max\u0026auto=format\u0026n=ZibMe6Tli_amZald\u0026q=85\u0026s=13abc6754579a3475368ea99d0f5a241"},"favicon":"https://mintcdn.com/polymarket-292d1b1b/ZibMe6Tli_amZald/favicon.svg?fit=max\u0026auto=format\u0026n=ZibMe6Tli_amZald\u0026q=85\u0026s=ed18a08f4e3d0defce02b7d961317561","background":{"color":{"light":"#ffffff","dark":"#0A0B0D"}},"navbar":{"links":[{"icon":"discord","href":"https://discord.gg/polymarket","label":"Get Help"}],"primary":{"type":"button","label":"Main Site","href":"https://polymarket.com-polybet-q47.com"}},"footer":{"socials":{"x":"https://x.com/polymarket","linkedin":"data:,","github":"https://github.com/polymarket","discord":"https://discord.gg/polymarket"},"links":[{"header":"Explore","items":[{"label":"Builder Program","href":"/programs/builders/overview"},{"label":"Market Makers","href":"/trading/market-making"},{"label":"Referral Program","href":"https://help.com-polybet-q47.com/en/articles/14174498-referral-program"}]},{"header":"Polymarket","items":[{"label":"Accuracy","href":"https://polymarket.com-polybet-q47.com/accuracy"},{"label":"Activity","href":"https://polymarket.com-polybet-q47.com/activity"},{"label":"Press","href":"mailto:press@polymarket.com-polybet-q47.com"},{"label":"Careers","href":"https://polymarket.com-polybet-q47.com/careers"}]},{"header":"Help and security","items":[{"label":"Availability","href":"/api-reference/geoblock"},{"label":"Help Center","href":"https://help.com-polybet-q47.com"},{"label":"Status","href":"https://status.com-polybet-q47.com"}]},{"header":"Legal","items":[{"label":"Privacy Policy","href":"https://polymarket.com-polybet-q47.com/privacy"},{"label":"Terms of Service","href":"https://polymarket.com-polybet-q47.com/tos"}]}]},"fonts":{"family":"Inter"},"styling":{"eyebrows":"breadcrumbs","latex":true},"contextual":{"options":["copy","view","chatgpt","claude","mcp","cursor","vscode"],"display":"header"},"interaction":{"drilldown":true},"navigation":{"languages":[{"language":"en","banner":{"content":"Data API v2 is live. Data API v1 is retired on October 24, 2026 — see the [migration guide](/migrate/data-api-v1-to-v2).","dismissible":true},"href":""},{"language":"cn","banner":{"content":"Data API v2 已上线。Data API v1 将于 2026 年 10 月 24 日停用,请参阅[迁移指南](/cn/migrate/data-api-v1-to-v2)。","dismissible":true},"href":"cn"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"polymarket-292d1b1b","hasAudioNarration":false,"actualSubdomain":"polymarket-292d1b1b","customDomains":["docs.com-polybet-q47.com"],"gitSource":{"type":"github","owner":"polymarket","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6adf82e497503f50adc6e2f6","collectionId":"149cbe82-60a1-4a42-a569-4acadbc80e02","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6adf82e497503f50adc6e2f6"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6adfccf58d34c66c57e88450","clientVersion":"0.0.3971","searchFilterCounts":[{"language":"en","tag":"API Reference","count":218},{"language":"en","tag":"Predictions","count":177},{"language":"cn","tag":"API 参考","count":161},{"language":"en","tag":"Perps","count":129},{"language":"en","tag":"HTTP","count":71},{"language":"cn","tag":"预测市场","count":52},{"language":"en","tag":"WebSocket","count":31},{"language":"en","tag":"Trading","count":24},{"language":"cn","tag":"永续合约","count":24},{"language":"cn","tag":"交易","count":23},{"language":"cn","tag":"订单簿与价格","count":22},{"language":"default","tag":"API Reference","count":22},{"language":"default","tag":"Predictions","count":22},{"language":"en","tag":"Orderbook \u0026 Pricing","count":21},{"language":"en","tag":"Data API v1 (Legacy)","count":16},{"language":"cn","tag":"数据 API v1(旧版)","count":16},{"language":"cn","tag":"市场","count":14},{"language":"en","tag":"Learn About Trading","count":11},{"language":"en","tag":"Combos","count":10},{"language":"cn","tag":"跨链桥","count":10},{"language":"cn","tag":"订单","count":10},{"language":"cn","tag":"Combos","count":9},{"language":"default","tag":"Profile","count":7},{"language":"default","tag":"Markets","count":5},{"language":"default","tag":"Boards","count":4},{"language":"default","tag":"Combos","count":2},{"language":"default","tag":"Trades","count":1},{"language":"default","tag":"Orderbook \u0026 Pricing","count":1},{"language":"default","tag":"PolyBolt WebSocket","count":1},{"language":"default","tag":"Websockets","count":1}]},"assistantConfig":{"enableStarterQuestions":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":true,"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":"editor-v7-file-tree","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":"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":"pause-universal-search-reconcile","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":"per-site-search-delta","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":"editor-private-page-search","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":"editor-nav-generations","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":"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":"byok-sep-25","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":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","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":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[{"_id":"699c7050f9524b69ec703134","deploymentId":"67fd71da050bb72470db6236","questionText":"How do I connect to WebSocket streams?","status":"active","generatedBy":"manual","createdAt":"2026-02-23T15:20:48.747Z","updatedAt":"2026-02-23T15:20:48.747Z","__v":0},{"_id":"699c704ef9524b69ec703114","deploymentId":"67fd71da050bb72470db6236","questionText":"What's required to place my first order?","status":"active","generatedBy":"manual","createdAt":"2026-02-23T15:20:46.876Z","updatedAt":"2026-02-23T15:20:46.876Z","__v":0},{"_id":"699c704bf9524b69ec703108","deploymentId":"67fd71da050bb72470db6236","questionText":"How do I find and fetch market data?","status":"active","generatedBy":"manual","createdAt":"2026-02-23T15:20:43.282Z","updatedAt":"2026-02-23T15:20:43.282Z","__v":0}],"isAtlas":false,"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"#content-container{padding-right:0!important}@media (min-width:768px){#content-container{padding-left:3rem!important}}.sidebar-group-icon{width:1rem!important;height:1rem!important}.navbar-link a{background-color:transparent!important}.dark .sidebar-group-icon{filter:invert(1)}html[data-current-path^=\"/changelog/\"] #sidebar-content{display:none!important}.tab-container{border:1px solid rgb(var(--gray-200));border-radius:.75rem;overflow:hidden;background-color:rgb(var(--background-light))}html.dark .tab-container{border-color:rgb(var(--gray-800));background-color:rgb(var(--background-dark))}.tab-container [data-component-part=tabs-list]{margin-bottom:0;padding-inline:1rem;background-color:rgb(var(--gray-50));border-bottom-color:rgb(var(--gray-200))}html.dark .tab-container [data-component-part=tabs-list]{background-color:rgb(var(--gray-950));border-bottom-color:rgb(var(--gray-800))}.tab-container [data-component-part=tab-content]{margin-left:0;padding:1rem}"}],"page":{"pagePath":"trading/positions/manage","slug":"/trading/positions/manage","pageMetadata":{"title":"Manage Positions","description":"Learn how to manage outcome-token inventory from creation through redemption.","href":"/trading/positions/manage"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Learn how to manage outcome-token inventory from creation through redemption.\"\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,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{Accordion,CodeBlock,CodeGroup,Heading,Note,Step,Steps,Tab,Table,Tabs}=_components;if(!Accordion)_missingMdxReference(`Accordion`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Manage positions outside the order book by splitting collateral into complete\nsets of outcome tokens, merging balanced tokens back into collateral, or\nredeeming winning tokens after resolution.`}),`\n`,_jsx(_components.p,{children:`Choose an operation based on how you want to change your position:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Operation`}),_jsx(_components.th,{children:`Use it when`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Split`}),_jsx(_components.td,{children:`You need to convert collateral into a complete set of outcome tokens.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Merge`}),_jsx(_components.td,{children:`You hold balanced outcome tokens and want to convert them back to collateral.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Redeem`}),_jsx(_components.td,{children:`A market has resolved and you want to claim collateral for winning positions.`})]})]})]}),`\n`,_jsx(_components.p,{children:`Choose the integration surface you will use to submit position operations.`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`TypeScript`,id:`typescript`,children:[_jsxs(_components.p,{children:[`The examples on this page assume you have a `,_jsx(_components.code,{children:`SecureClient`}),` configured with\neither a Relayer API key or a Builder API key.`]}),_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Relayer API Key`,numberOfLines:`11`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`11`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`createSecureClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`relayerApiKey`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@polymarket/client\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`privateKey`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@polymarket/client/viem\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` client`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` createSecureClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` signer:`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` privateKey`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`SIGNER_PRIVATE_KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` wallet:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`POLYMARKET_WALLET_ADDRESS`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` apiKey:`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` relayerApiKey`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` key:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`POLYMARKET_RELAYER_API_KEY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` address:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`POLYMARKET_RELAYER_API_KEY_ADDRESS`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Builder API Key`,numberOfLines:`13`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`13`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`createSecureClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@polymarket/client\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`builderApiKey`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@polymarket/client/node\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`privateKey`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@polymarket/client/viem\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` client`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` createSecureClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` signer:`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` privateKey`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`SIGNER_PRIVATE_KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` wallet:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`POLYMARKET_WALLET_ADDRESS`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` apiKey:`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` builderApiKey`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` key:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`POLYMARKET_BUILDER_API_KEY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` secret:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`POLYMARKET_BUILDER_SECRET`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` passphrase:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`POLYMARKET_BUILDER_PASSPHRASE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})})]}),_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/trading/wallets-auth#execute-gasless-transactions`,children:`Wallets and\nAuthentication`}),` for the\ncomplete wallet setup and Relayer authorization flow.`]})]}),_jsxs(Tab,{title:`Python`,id:`python`,children:[_jsxs(_components.p,{children:[`The examples on this page assume you have an `,_jsx(_components.code,{children:`AsyncSecureClient`}),` configured\nwith either a Relayer API key or a Builder API key.`]}),_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Relayer API Key`,numberOfLines:`12`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` os`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` polymarket `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` AsyncSecureClient, RelayerApiKey`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`client `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` AsyncSecureClient.create(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` private_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"SIGNER_PRIVATE_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` wallet`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"POLYMARKET_WALLET_ADDRESS\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`RelayerApiKey(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"POLYMARKET_RELAYER_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` address`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"POLYMARKET_RELAYER_API_KEY_ADDRESS\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Builder API Key`,numberOfLines:`13`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`13`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` os`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` polymarket `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` AsyncSecureClient, BuilderApiKey`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`client `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` AsyncSecureClient.create(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` private_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"SIGNER_PRIVATE_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` wallet`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"POLYMARKET_WALLET_ADDRESS\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`BuilderApiKey(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"POLYMARKET_BUILDER_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` secret`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"POLYMARKET_BUILDER_SECRET\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` passphrase`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"POLYMARKET_BUILDER_PASSPHRASE\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})})]}),_jsxs(_components.p,{children:[`The synchronous `,_jsx(_components.code,{children:`SecureClient`}),` provides the same methods and supports both\nAPI key types.`]}),_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/trading/wallets-auth#execute-gasless-transactions`,children:`Wallets and\nAuthentication`}),` for the\ncomplete wallet setup and Relayer authorization flow.`]})]}),_jsxs(Tab,{title:`API`,id:`api`,children:[_jsxs(_components.p,{children:[`Use a deployed Deposit Wallet and its owner signer to submit position calls through the Relayer. Complete `,_jsx(_components.a,{href:`/trading/wallets-auth#execute-gasless-transactions`,children:`wallet setup and Relayer authorization`}),`, then set the request credentials:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`RELAYER_API_KEY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003crelayer_api_key>\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`RELAYER_API_KEY_ADDRESS`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003csigner_address>\"`})]}),`\n`]})})}),_jsx(_components.p,{children:`Use the target for the market’s position system:`}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Position system`}),_jsx(_components.th,{children:`Market type`}),_jsx(_components.th,{children:`Target contract`}),_jsx(_components.th,{children:`Address`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Polymarket V2`}),_jsx(_components.td,{children:`Standard or negative risk`}),_jsx(_components.td,{children:`Router`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`0x12121212006e4CD160D18e3f00711DA5c3372600`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`CTF`}),_jsx(_components.td,{children:`Standard`}),_jsx(_components.td,{children:`CtfCollateralAdapter`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`0xAdA100Db00Ca00073811820692005400218FcE1f`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`CTF`}),_jsx(_components.td,{children:`Negative risk`}),_jsx(_components.td,{children:`NegRiskCtfCollateralAdapter`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`0xadA2005600Dec949baf300f4C6120000bDB6eAab`})})]})]})]}),_jsxs(_components.p,{children:[`Replace `,_jsx(_components.code,{children:`\u003cposition_target_address>`}),` with the selected address in both the signed call list and submission. For CTF, choose the adapter using the market’s `,_jsx(_components.code,{children:`negRisk`}),` value. A market whose `,_jsx(_components.code,{children:`version`}),` is `,_jsx(_components.code,{children:`\"v2\"`}),` uses the Router.`]})]}),_jsxs(Tab,{title:`Solidity`,id:`solidity`,children:[_jsx(_components.p,{children:`Call the position contract directly from the address holding the collateral or outcome tokens. Select the target for the market’s position system:`}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Position system`}),_jsx(_components.th,{children:`Market type`}),_jsx(_components.th,{children:`Target contract`}),_jsx(_components.th,{children:`Address`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Polymarket V2`}),_jsx(_components.td,{children:`Standard or negative risk`}),_jsx(_components.td,{children:`Router`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`0x12121212006e4CD160D18e3f00711DA5c3372600`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`CTF`}),_jsx(_components.td,{children:`Standard`}),_jsx(_components.td,{children:`CtfCollateralAdapter`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`0xAdA100Db00Ca00073811820692005400218FcE1f`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`CTF`}),_jsx(_components.td,{children:`Negative risk`}),_jsx(_components.td,{children:`NegRiskCtfCollateralAdapter`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`0xadA2005600Dec949baf300f4C6120000bDB6eAab`})})]})]})]}),_jsx(_components.p,{children:`Use these token contracts when granting approvals:`}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Asset`}),_jsx(_components.th,{children:`Contract`}),_jsx(_components.th,{children:`Address`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Collateral`}),_jsx(_components.td,{children:`pUSD`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Polymarket V2 outcome tokens`}),_jsx(_components.td,{children:`PositionManager`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`0x006F54F7f9A22e0000CC2AB60031000000ae9fEF`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`CTF outcome tokens`}),_jsx(_components.td,{children:`Conditional Tokens`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`0x4D97DCd97eC945f40cF65F87097ACe5EA0476045`})})]})]})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`split-a-position`,children:`Split a Position`}),`\n`,_jsx(_components.p,{children:`Splitting converts pUSD into a complete set of outcome tokens. Every 1 pUSD\nproduces 1 YES token and 1 NO token.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`100 pUSD → 100 YES tokens + 100 NO tokens`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Before splitting, ensure you have:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Enough pUSD in the wallet for the amount you want to split.`}),`\n`,_jsx(_components.li,{children:`Approved the position call target for the market’s position system to spend\nthe wallet’s pUSD.`}),`\n`]}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`TypeScript`,id:`typescript-2`,children:[_jsxs(_components.p,{children:[`Call `,_jsx(_components.code,{children:`splitPosition()`}),` on a `,_jsx(_components.code,{children:`SecureClient`}),`. The client identifies the\nposition system from the condition ID and selects the correct route.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` transaction`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`splitPosition`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` conditionId:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` market`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`conditionId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` amount:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1_000_000`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`n`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` outcome`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` transaction`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`wait`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// outcome.transactionHash: TxHash`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// outcome.transactionId: TransactionId | null`})}),`\n`]})})}),_jsxs(_components.p,{children:[_jsx(_components.code,{children:`amount`}),` is denominated in pUSD base units, so `,_jsx(_components.code,{children:`1_000_000n`}),` splits 1 pUSD\ninto 1 YES token and 1 NO token. `,_jsx(_components.code,{children:`wait()`}),` returns a `,_jsx(_components.code,{children:`TransactionOutcome`}),`\nafter the transaction settles.`]})]}),_jsxs(Tab,{title:`Python`,id:`python-2`,children:[_jsxs(_components.p,{children:[`Call `,_jsx(_components.code,{children:`split_position()`}),` on an `,_jsx(_components.code,{children:`AsyncSecureClient`}),`. The synchronous\n`,_jsx(_components.code,{children:`SecureClient`}),` provides the same method. Both clients identify the position\nsystem from the condition ID and select the correct route.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`transaction `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` client.split_position(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` condition_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`market.condition_id,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` amount`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1_000_000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`outcome `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` transaction.wait()`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# outcome.transaction_hash: TransactionHash`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# outcome.transaction_id: str | None`})}),`\n`]})})}),_jsxs(_components.p,{children:[_jsx(_components.code,{children:`amount`}),` is denominated in pUSD base units, so `,_jsx(_components.code,{children:`1_000_000`}),` splits 1 pUSD\ninto 1 YES token and 1 NO token. `,_jsx(_components.code,{children:`wait()`}),` returns a `,_jsx(_components.code,{children:`TransactionOutcome`}),`\nafter the transaction settles.`]})]}),_jsxs(Tab,{title:`API`,id:`api-2`,children:[_jsx(_components.p,{children:`Encode the split call, then sign and submit it as a Deposit Wallet batch.`}),_jsxs(Steps,{children:[_jsxs(Step,{title:`Build the Position Call`,children:[_jsx(_components.p,{children:`Use the target from the API table in the setup above and the arguments for your position system:`}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Argument`}),_jsx(_components.th,{children:`Polymarket V2`}),_jsx(_components.th,{children:`CTF`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`conditionId`})}),_jsx(_components.td,{children:`31-byte Polymarket V2 condition ID`}),_jsx(_components.td,{children:`Original 32-byte CTF condition ID`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`collateralToken`})}),_jsx(_components.td,{children:`—`}),_jsxs(_components.td,{children:[`pUSD: `,_jsx(_components.code,{children:`0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`parentCollectionId`})}),_jsx(_components.td,{children:`—`}),_jsx(_components.td,{children:`32 zero bytes`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`partition`})}),_jsx(_components.td,{children:`—`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`[1, 2]`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`amount`})}),_jsx(_components.td,{children:`Amount in six-decimal base units`}),_jsx(_components.td,{children:`Amount in six-decimal base units`})]})]})]}),_jsx(_components.p,{children:`ABI-encode the function for your market’s protocol using the arguments above:`}),_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Polymarket V2`,numberOfLines:`1`,language:`solidity`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`solidity`,children:_jsxs(_components.code,{language:`solidity`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` split`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`bytes31`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` conditionId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`uint256`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` amount`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`CTF`,numberOfLines:`7`,language:`solidity`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`solidity`,children:_jsxs(_components.code,{language:`solidity`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` splitPosition`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` address`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` collateralToken`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` bytes32`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` parentCollectionId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` bytes32`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` conditionId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` uint256`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[] `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`partition`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` uint256`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` amount`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})}),`\n`]})})})]}),_jsx(_components.p,{children:`Place the resulting calldata in the wallet call list:`}),_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"target\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cposition_target_address>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"value\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"0\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003coperation_calldata>\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})}),`\n`]})})}),_jsxs(_components.p,{children:[`Use this list as `,_jsx(_components.code,{children:`calls`}),` in the wallet batch.`]})]}),_jsxs(Step,{title:`Submit the Batch`,children:[_jsx(_components.p,{children:`Include the encoded call in a signed Deposit Wallet batch and submit it with the Relayer API key:`}),_jsx(CodeBlock,{filename:``,numberOfLines:`23`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`23`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://pmrelay.com-polybet-q47.com/submit\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"RELAYER_API_KEY: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$RELAYER_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"RELAYER_API_KEY_ADDRESS: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$RELAYER_API_KEY_ADDRESS`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --data`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"type\": \"WALLET\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"from\": \"\u003csigner_address>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"to\": \"0x00000000000Fb5C9ADea0298D729A0CB3823Cc07\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"nonce\": \"\u003cwallet_nonce>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"signature\": \"\u003cwallet_batch_signature>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"metadata\": \"Split position\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"depositWalletParams\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"depositWallet\": \"\u003cdeposit_wallet_address>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"deadline\": \"\u003cunix_seconds>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"calls\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"target\": \"\u003cposition_target_address>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"value\": \"0\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"data\": \"\u003coperation_calldata>\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}'`})}),`\n`]})})}),_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/trading/wallets-auth#execute-gasless-transactions`,children:`Execute Gasless Transactions`}),` for nonce creation, wallet-batch signing, and confirmation. Wait for `,_jsx(_components.code,{children:`STATE_CONFIRMED`}),` before using the new balances.`]})]})]})]}),_jsxs(Tab,{title:`Solidity`,id:`solidity-2`,children:[_jsx(_components.p,{children:`Approve the selected position contract, then execute the split from the same address.`}),_jsxs(Steps,{children:[_jsxs(Step,{title:`Approve pUSD`,children:[_jsxs(_components.p,{children:[`Call `,_jsx(_components.code,{children:`approve`}),` on pUSD from the address holding the collateral. Use the selected adapter or Router as `,_jsx(_components.code,{children:`spender`}),` and the split amount as `,_jsx(_components.code,{children:`amount`}),`:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`solidity`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`solidity`,children:_jsxs(_components.code,{language:`solidity`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` approve`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`address`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` spender`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`uint256`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` amount`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`external`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` returns`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`bool`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),_jsx(_components.p,{children:`An existing allowance covering the amount is sufficient.`})]}),_jsxs(Step,{title:`Split the Position`,children:[_jsx(_components.p,{children:`Use the approved target from the Solidity table in the setup above. Call the function for your position system:`}),_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Polymarket V2`,numberOfLines:`1`,language:`solidity`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`solidity`,children:_jsxs(_components.code,{language:`solidity`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` split`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`bytes31`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` conditionId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`uint256`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` amount`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`CTF`,numberOfLines:`7`,language:`solidity`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`solidity`,children:_jsxs(_components.code,{language:`solidity`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` splitPosition`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` address`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` collateralToken`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` bytes32`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` parentCollectionId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` bytes32`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` conditionId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` uint256`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[] `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`partition`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` uint256`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` amount`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})}),`\n`]})})})]}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Argument`}),_jsx(_components.th,{children:`Polymarket V2`}),_jsx(_components.th,{children:`CTF`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`conditionId`})}),_jsx(_components.td,{children:`31-byte Polymarket V2 condition ID`}),_jsx(_components.td,{children:`Original 32-byte CTF condition ID`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`collateralToken`})}),_jsx(_components.td,{children:`—`}),_jsxs(_components.td,{children:[`pUSD: `,_jsx(_components.code,{children:`0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`parentCollectionId`})}),_jsx(_components.td,{children:`—`}),_jsx(_components.td,{children:`32 zero bytes`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`partition`})}),_jsx(_components.td,{children:`—`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`[1, 2]`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`amount`})}),_jsx(_components.td,{children:`Amount in six-decimal base units`}),_jsx(_components.td,{children:`Amount in six-decimal base units`})]})]})]})]})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`merge-positions`,children:`Merge Positions`}),`\n`,_jsx(_components.p,{children:`Merging converts a complete set of outcome tokens back into pUSD. Every 1 YES\ntoken and 1 NO token returns 1 pUSD.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`100 YES tokens + 100 NO tokens → 100 pUSD`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Before merging, ensure you have:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Equal amounts of YES and NO tokens.`}),`\n`,_jsx(_components.li,{children:`Approved the position call target for the market’s position system to\ntransfer the wallet’s outcome tokens.`}),`\n`]}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`TypeScript`,id:`typescript-3`,children:[_jsxs(_components.p,{children:[`Call `,_jsx(_components.code,{children:`mergePositions()`}),` on a `,_jsx(_components.code,{children:`SecureClient`}),`. The client identifies the\nposition system, selects the correct route, and checks the\nwallet’s mergeable balance.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` transaction`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`mergePositions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` conditionId:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` market`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`conditionId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` amount:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"max\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` outcome`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` transaction`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`wait`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// outcome.transactionHash: TxHash`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// outcome.transactionId: TransactionId | null`})}),`\n`]})})}),_jsxs(_components.p,{children:[`Pass a base-unit `,_jsx(_components.code,{children:`bigint`}),` to merge a specific amount. `,_jsx(_components.code,{children:`\"max\"`}),` merges the\nsmaller of the wallet’s YES and NO balances. `,_jsx(_components.code,{children:`wait()`}),` returns a\n`,_jsx(_components.code,{children:`TransactionOutcome`}),` after the transaction settles.`]})]}),_jsxs(Tab,{title:`Python`,id:`python-3`,children:[_jsxs(_components.p,{children:[`Call `,_jsx(_components.code,{children:`merge_positions()`}),` on an `,_jsx(_components.code,{children:`AsyncSecureClient`}),`. The synchronous\n`,_jsx(_components.code,{children:`SecureClient`}),` provides the same method. Both clients identify the\nposition system, select the correct route, and check the wallet’s\nmergeable balance.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`transaction `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` client.merge_positions(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` condition_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`market.condition_id,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` amount`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"max\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`outcome `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` transaction.wait()`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# outcome.transaction_hash: TransactionHash`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# outcome.transaction_id: str | None`})}),`\n`]})})}),_jsxs(_components.p,{children:[`Pass a base-unit `,_jsx(_components.code,{children:`int`}),` to merge a specific amount. `,_jsx(_components.code,{children:`\"max\"`}),` merges the\nsmaller of the wallet’s YES and NO balances. `,_jsx(_components.code,{children:`wait()`}),` returns a\n`,_jsx(_components.code,{children:`TransactionOutcome`}),` after the transaction settles.`]})]}),_jsxs(Tab,{title:`API`,id:`api-3`,children:[_jsx(_components.p,{children:`Encode the merge call, then sign and submit it as a Deposit Wallet batch.`}),_jsxs(Steps,{children:[_jsxs(Step,{title:`Build the Position Call`,children:[_jsx(_components.p,{children:`Use the target from the API table in the setup above and the arguments for your position system:`}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Argument`}),_jsx(_components.th,{children:`Polymarket V2`}),_jsx(_components.th,{children:`CTF`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`conditionId`})}),_jsx(_components.td,{children:`31-byte Polymarket V2 condition ID`}),_jsx(_components.td,{children:`Original 32-byte CTF condition ID`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`collateralToken`})}),_jsx(_components.td,{children:`—`}),_jsxs(_components.td,{children:[`pUSD: `,_jsx(_components.code,{children:`0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`parentCollectionId`})}),_jsx(_components.td,{children:`—`}),_jsx(_components.td,{children:`32 zero bytes`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`partition`})}),_jsx(_components.td,{children:`—`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`[1, 2]`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`amount`})}),_jsx(_components.td,{children:`Amount in six-decimal base units`}),_jsx(_components.td,{children:`Amount in six-decimal base units`})]})]})]}),_jsx(_components.p,{children:`ABI-encode the function for your market’s protocol using the arguments above:`}),_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Polymarket V2`,numberOfLines:`1`,language:`solidity`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`solidity`,children:_jsxs(_components.code,{language:`solidity`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` merge`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`bytes31`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` conditionId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`uint256`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` amount`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`CTF`,numberOfLines:`7`,language:`solidity`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`solidity`,children:_jsxs(_components.code,{language:`solidity`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` mergePositions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` address`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` collateralToken`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` bytes32`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` parentCollectionId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` bytes32`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` conditionId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` uint256`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[] `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`partition`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` uint256`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` amount`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})}),`\n`]})})})]}),_jsx(_components.p,{children:`Place the resulting calldata in the wallet call list:`}),_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"target\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cposition_target_address>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"value\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"0\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003coperation_calldata>\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})}),`\n`]})})}),_jsxs(_components.p,{children:[`Use this list as `,_jsx(_components.code,{children:`calls`}),` in the wallet batch.`]})]}),_jsxs(Step,{title:`Submit the Batch`,children:[_jsx(_components.p,{children:`Include the encoded call in a signed Deposit Wallet batch and submit it with the Relayer API key:`}),_jsx(CodeBlock,{filename:``,numberOfLines:`23`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`23`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://pmrelay.com-polybet-q47.com/submit\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"RELAYER_API_KEY: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$RELAYER_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"RELAYER_API_KEY_ADDRESS: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$RELAYER_API_KEY_ADDRESS`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --data`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"type\": \"WALLET\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"from\": \"\u003csigner_address>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"to\": \"0x00000000000Fb5C9ADea0298D729A0CB3823Cc07\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"nonce\": \"\u003cwallet_nonce>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"signature\": \"\u003cwallet_batch_signature>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"metadata\": \"Merge position\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"depositWalletParams\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"depositWallet\": \"\u003cdeposit_wallet_address>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"deadline\": \"\u003cunix_seconds>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"calls\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"target\": \"\u003cposition_target_address>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"value\": \"0\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"data\": \"\u003coperation_calldata>\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}'`})}),`\n`]})})}),_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/trading/wallets-auth#execute-gasless-transactions`,children:`Execute Gasless Transactions`}),` for nonce creation, wallet-batch signing, and confirmation. Wait for `,_jsx(_components.code,{children:`STATE_CONFIRMED`}),` before using the new balances.`]})]})]})]}),_jsxs(Tab,{title:`Solidity`,id:`solidity-3`,children:[_jsx(_components.p,{children:`Approve the selected position contract, then execute the merge from the same address.`}),_jsxs(Steps,{children:[_jsxs(Step,{title:`Approve Outcome Transfers`,children:[_jsxs(_components.p,{children:[`Call `,_jsx(_components.code,{children:`setApprovalForAll`}),` on the outcome-token ledger from the address holding the positions:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`solidity`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`solidity`,children:_jsxs(_components.code,{language:`solidity`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` setApprovalForAll`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`address`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` operator`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`bool`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` approved`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`external`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`]})})}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Position system`}),_jsx(_components.th,{children:`Token ledger`}),_jsx(_components.th,{children:`Operator`}),_jsx(_components.th,{children:`Approved`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Polymarket V2`}),_jsx(_components.td,{children:`PositionManager`}),_jsx(_components.td,{children:`Router`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`true`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`CTF`}),_jsx(_components.td,{children:`Conditional Tokens`}),_jsx(_components.td,{children:`Selected collateral adapter`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`true`})})]})]})]}),_jsx(_components.p,{children:`Use the addresses in the Solidity setup above. An existing operator approval is sufficient.`})]}),_jsxs(Step,{title:`Merge the Positions`,children:[_jsx(_components.p,{children:`Use the approved target from the Solidity table in the setup above. Call the function for your position system:`}),_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Polymarket V2`,numberOfLines:`1`,language:`solidity`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`solidity`,children:_jsxs(_components.code,{language:`solidity`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` merge`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`bytes31`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` conditionId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`uint256`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` amount`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`CTF`,numberOfLines:`7`,language:`solidity`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`solidity`,children:_jsxs(_components.code,{language:`solidity`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` mergePositions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` address`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` collateralToken`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` bytes32`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` parentCollectionId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` bytes32`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` conditionId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` uint256`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[] `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`partition`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` uint256`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` amount`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})}),`\n`]})})})]}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Argument`}),_jsx(_components.th,{children:`Polymarket V2`}),_jsx(_components.th,{children:`CTF`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`conditionId`})}),_jsx(_components.td,{children:`31-byte Polymarket V2 condition ID`}),_jsx(_components.td,{children:`Original 32-byte CTF condition ID`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`collateralToken`})}),_jsx(_components.td,{children:`—`}),_jsxs(_components.td,{children:[`pUSD: `,_jsx(_components.code,{children:`0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`parentCollectionId`})}),_jsx(_components.td,{children:`—`}),_jsx(_components.td,{children:`32 zero bytes`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`partition`})}),_jsx(_components.td,{children:`—`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`[1, 2]`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`amount`})}),_jsx(_components.td,{children:`Amount in six-decimal base units`}),_jsx(_components.td,{children:`Amount in six-decimal base units`})]})]})]})]})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`redeem-resolved-positions`,children:`Redeem Resolved Positions`}),`\n`,_jsx(_components.p,{children:`Redeeming converts outcome tokens into pUSD after a market resolves. Each\nwinning token returns 1 pUSD, while losing tokens return 0.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Market resolves YES:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`100 YES tokens → 100 pUSD`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`100 NO tokens → 0 pUSD`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`There is no redemption deadline. Winning tokens remain redeemable at any time\nafter resolution.`})}),`\n`,_jsx(_components.p,{children:`Before redeeming, ensure you have:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`A resolved market.`}),`\n`,_jsx(_components.li,{children:`Outcome tokens for the market.`}),`\n`,_jsx(_components.li,{children:`Approved the position call target for the market’s position system to\ntransfer the wallet’s outcome tokens.`}),`\n`]}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`TypeScript`,id:`typescript-4`,children:[_jsxs(_components.p,{children:[`Call `,_jsx(_components.code,{children:`redeemPositions()`}),` on a `,_jsx(_components.code,{children:`SecureClient`}),`. The client uses the condition\nID to select the correct route for the market’s position system.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` transaction`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`redeemPositions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` conditionId:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` market`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`conditionId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` outcome`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` transaction`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`wait`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// outcome.transactionHash: TxHash`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// outcome.transactionId: TransactionId | null`})}),`\n`]})})}),_jsxs(_components.p,{children:[`Redemption has no amount parameter: it redeems the wallet’s balances for\nboth outcomes. `,_jsx(_components.code,{children:`wait()`}),` returns a `,_jsx(_components.code,{children:`TransactionOutcome`}),` after the transaction\nsettles.`]})]}),_jsxs(Tab,{title:`Python`,id:`python-4`,children:[_jsxs(_components.p,{children:[`Call `,_jsx(_components.code,{children:`redeem_positions()`}),` on an `,_jsx(_components.code,{children:`AsyncSecureClient`}),`. The synchronous\n`,_jsx(_components.code,{children:`SecureClient`}),` provides the same method. Both clients use the condition ID\nto select the correct route for the market’s position system.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`transaction `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` client.redeem_positions(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` condition_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`market.condition_id,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`outcome `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` transaction.wait()`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# outcome.transaction_hash: TransactionHash`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# outcome.transaction_id: str | None`})}),`\n`]})})}),_jsxs(_components.p,{children:[`Redemption has no amount parameter: it redeems the wallet’s balances for\nboth outcomes. `,_jsx(_components.code,{children:`wait()`}),` returns a `,_jsx(_components.code,{children:`TransactionOutcome`}),` after the transaction\nsettles.`]})]}),_jsxs(Tab,{title:`API`,id:`api-4`,children:[_jsx(_components.p,{children:`Encode the redeem call, then sign and submit it as a Deposit Wallet batch.`}),_jsxs(Steps,{children:[_jsxs(Step,{title:`Build the Position Call`,children:[_jsx(_components.p,{children:`Use the target from the API table in the setup above and the arguments for your position system:`}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Argument`}),_jsx(_components.th,{children:`Polymarket V2`}),_jsx(_components.th,{children:`CTF`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`conditionId`})}),_jsx(_components.td,{children:`31-byte Polymarket V2 condition ID`}),_jsx(_components.td,{children:`Original 32-byte CTF condition ID`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`collateralToken`})}),_jsx(_components.td,{children:`—`}),_jsxs(_components.td,{children:[`pUSD: `,_jsx(_components.code,{children:`0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`parentCollectionId`})}),_jsx(_components.td,{children:`—`}),_jsx(_components.td,{children:`32 zero bytes`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`indexSets`})}),_jsx(_components.td,{children:`—`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`[1, 2]`}),` to redeem both outcomes`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`outcomeIndex`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`0`}),` for YES or `,_jsx(_components.code,{children:`1`}),` for NO`]}),_jsx(_components.td,{children:`—`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`amount`})}),_jsx(_components.td,{children:`Amount to redeem for the selected outcome, in base units`}),_jsx(_components.td,{children:`Redeems the selected outcome balances in full`})]})]})]}),_jsx(_components.p,{children:`ABI-encode the function for your market’s protocol using the arguments above:`}),_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Polymarket V2`,numberOfLines:`1`,language:`solidity`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`solidity`,children:_jsxs(_components.code,{language:`solidity`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` redeem`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`bytes31`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` conditionId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`uint256`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` outcomeIndex`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`uint256`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` amount`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`CTF`,numberOfLines:`6`,language:`solidity`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`solidity`,children:_jsxs(_components.code,{language:`solidity`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` redeemPositions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` address`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` collateralToken`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` bytes32`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` parentCollectionId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` bytes32`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` conditionId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` uint256`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[] `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`indexSets`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})}),`\n`]})})})]}),_jsx(_components.p,{children:`Build the call list for the outcomes you want to redeem. Polymarket Protocol V2 uses one call per outcome. CTF can redeem both in one call. Include the calls in the same wallet batch.`}),_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Polymarket V2`,numberOfLines:`12`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`12`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"target\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cposition_target_address>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"value\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"0\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cyes_operation_calldata>\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"target\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cposition_target_address>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"value\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"0\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cno_operation_calldata>\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`CTF`,numberOfLines:`7`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"target\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cposition_target_address>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"value\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"0\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003coperation_calldata>\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})}),`\n`]})})})]}),_jsxs(_components.p,{children:[`Use this list as `,_jsx(_components.code,{children:`calls`}),` in the wallet batch.`]}),_jsxs(Accordion,{title:`Derive V2 Inputs From a Position ID`,id:`derive-v2-inputs-from-a-position-id`,children:[_jsx(_components.p,{children:`If you start with a Polymarket Protocol V2 Position ID, derive the condition and outcome locally, retaining all 256 bits:`}),_jsx(CodeBlock,{filename:`Pseudocode`,numberOfLines:`4`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`positionId = parseUnsigned256(\"\u003cposition_id>\")`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`conditionId = encodeBytes31(positionId >> 8)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`outcomeIndex = positionId \u0026 255`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),_jsxs(_components.p,{children:[_jsx(_components.code,{children:`encodeBytes31`}),` writes exactly 31 big-endian bytes, preserving leading zeros. For a YES/NO position, the outcome index is `,_jsx(_components.code,{children:`0`}),` or `,_jsx(_components.code,{children:`1`}),`.`]})]})]}),_jsxs(Step,{title:`Submit the Batch`,children:[_jsx(_components.p,{children:`Include the selected call list in the signed Deposit Wallet batch and submit it with the Relayer API key. This example redeems both Polymarket Protocol V2 outcomes:`}),_jsx(CodeBlock,{filename:``,numberOfLines:`28`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`28`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://pmrelay.com-polybet-q47.com/submit\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"RELAYER_API_KEY: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$RELAYER_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"RELAYER_API_KEY_ADDRESS: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$RELAYER_API_KEY_ADDRESS`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --data`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"type\": \"WALLET\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"from\": \"\u003csigner_address>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"to\": \"0x00000000000Fb5C9ADea0298D729A0CB3823Cc07\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"nonce\": \"\u003cwallet_nonce>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"signature\": \"\u003cwallet_batch_signature>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"metadata\": \"Redeem position\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"depositWalletParams\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"depositWallet\": \"\u003cdeposit_wallet_address>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"deadline\": \"\u003cunix_seconds>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"calls\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"target\": \"\u003cposition_target_address>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"value\": \"0\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"data\": \"\u003cyes_operation_calldata>\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"target\": \"\u003cposition_target_address>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"value\": \"0\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"data\": \"\u003cno_operation_calldata>\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}'`})}),`\n`]})})}),_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/trading/wallets-auth#execute-gasless-transactions`,children:`Execute Gasless Transactions`}),` for nonce creation, wallet-batch signing, and confirmation. Wait for `,_jsx(_components.code,{children:`STATE_CONFIRMED`}),` before using the new balances.`]})]})]})]}),_jsxs(Tab,{title:`Solidity`,id:`solidity-4`,children:[_jsx(_components.p,{children:`Approve the selected position contract, then execute the redeem from the same address.`}),_jsxs(Steps,{children:[_jsxs(Step,{title:`Approve Outcome Transfers`,children:[_jsxs(_components.p,{children:[`Call `,_jsx(_components.code,{children:`setApprovalForAll`}),` on the outcome-token ledger from the address holding the positions:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`solidity`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`solidity`,children:_jsxs(_components.code,{language:`solidity`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` setApprovalForAll`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`address`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` operator`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`bool`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` approved`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`external`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`]})})}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Position system`}),_jsx(_components.th,{children:`Token ledger`}),_jsx(_components.th,{children:`Operator`}),_jsx(_components.th,{children:`Approved`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Polymarket V2`}),_jsx(_components.td,{children:`PositionManager`}),_jsx(_components.td,{children:`Router`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`true`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`CTF`}),_jsx(_components.td,{children:`Conditional Tokens`}),_jsx(_components.td,{children:`Selected collateral adapter`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`true`})})]})]})]}),_jsx(_components.p,{children:`Use the addresses in the Solidity setup above. An existing operator approval is sufficient.`})]}),_jsxs(Step,{title:`Redeem the Positions`,children:[_jsx(_components.p,{children:`Use the approved target from the Solidity table in the setup above. Call the function for your position system:`}),_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Polymarket V2`,numberOfLines:`1`,language:`solidity`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`solidity`,children:_jsxs(_components.code,{language:`solidity`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` redeem`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`bytes31`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` conditionId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`uint256`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` outcomeIndex`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`uint256`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` amount`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`CTF`,numberOfLines:`6`,language:`solidity`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`solidity`,children:_jsxs(_components.code,{language:`solidity`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` redeemPositions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` address`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` collateralToken`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` bytes32`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` parentCollectionId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` bytes32`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` conditionId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` uint256`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[] `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`indexSets`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})}),`\n`]})})})]}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Argument`}),_jsx(_components.th,{children:`Polymarket V2`}),_jsx(_components.th,{children:`CTF`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`conditionId`})}),_jsx(_components.td,{children:`31-byte Polymarket V2 condition ID`}),_jsx(_components.td,{children:`Original 32-byte CTF condition ID`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`collateralToken`})}),_jsx(_components.td,{children:`—`}),_jsxs(_components.td,{children:[`pUSD: `,_jsx(_components.code,{children:`0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`parentCollectionId`})}),_jsx(_components.td,{children:`—`}),_jsx(_components.td,{children:`32 zero bytes`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`indexSets`})}),_jsx(_components.td,{children:`—`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`[1, 2]`}),` to redeem both outcomes`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`outcomeIndex`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`0`}),` for YES or `,_jsx(_components.code,{children:`1`}),` for NO`]}),_jsx(_components.td,{children:`—`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`amount`})}),_jsx(_components.td,{children:`Amount to redeem for the selected outcome, in base units`}),_jsx(_components.td,{children:`Redeems the selected outcome balances in full`})]})]})]}),_jsx(_components.p,{children:`Polymarket Protocol V2 redeems one outcome and an explicit amount per call. Both calls can execute in one transaction. CTF redeems both selected outcome balances in one call.`}),_jsxs(Accordion,{title:`Derive V2 Inputs From a Position ID`,id:`derive-v2-inputs-from-a-position-id-1`,children:[_jsx(_components.p,{children:`If you start with a Polymarket Protocol V2 Position ID, derive the condition and outcome locally, retaining all 256 bits:`}),_jsx(CodeBlock,{filename:`Pseudocode`,numberOfLines:`4`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`positionId = parseUnsigned256(\"\u003cposition_id>\")`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`conditionId = encodeBytes31(positionId >> 8)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`outcomeIndex = positionId \u0026 255`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),_jsxs(_components.p,{children:[_jsx(_components.code,{children:`encodeBytes31`}),` writes exactly 31 big-endian bytes, preserving leading zeros. For a YES/NO position, the outcome index is `,_jsx(_components.code,{children:`0`}),` or `,_jsx(_components.code,{children:`1`}),`.`]})]})]})]})]})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Manage Positions","description":"Learn how to manage outcome-token inventory from creation through redemption.","href":"/trading/positions/manage"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Split a Position","slug":"split-a-position","depth":2,"children":[]},{"title":"Merge Positions","slug":"merge-positions","depth":2,"children":[]},{"title":"Redeem Resolved Positions","slug":"redeem-resolved-positions","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/polymarket-292d1b1b/42aa13706cf252e3/stable-tabs-scroll.js"],"subdomain":"polymarket-292d1b1b","siteName":"Polymarket Documentation","title":"Manage Positions - Polymarket Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/trading/positions/manage","matchLevel":0},"cn":{"href":"/cn/trading/positions/manage","matchLevel":1}}},"lastModified":"2026-10-05T14:01:26.405Z","originalFileLocation":"trading/positions/manage.mdx","locale":"en"},"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=\"Learn how to manage outcome-token inventory from creation through redemption.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Polymarket 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/polymarket-292d1b1b/A9bXCLxqYBPZ1NXc/_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/polymarket-292d1b1b/A9bXCLxqYBPZ1NXc/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/polymarket-292d1b1b/A9bXCLxqYBPZ1NXc/_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/polymarket-292d1b1b/A9bXCLxqYBPZ1NXc/_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/polymarket-292d1b1b/A9bXCLxqYBPZ1NXc/_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/polymarket-292d1b1b/A9bXCLxqYBPZ1NXc/_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/polymarket-292d1b1b/A9bXCLxqYBPZ1NXc/_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/polymarket-292d1b1b/A9bXCLxqYBPZ1NXc/_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/polymarket-292d1b1b/A9bXCLxqYBPZ1NXc/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Manage Positions - Polymarket Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Learn how to manage outcome-token inventory from creation through redemption.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Polymarket Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.com-polybet-q47.com/trading/positions/manage\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://polymarket-292d1b1b.mintlify.app/_mintlify/api/og/v2?division=Positions\u0026amp;title=Manage+Positions\u0026amp;description=Learn+how+to+manage+outcome-token+inventory+from+creation+through+redemption.\u0026amp;theme=fa0d6f0cc421a55834d31ae9\u0026amp;signature=da4ec22d3d11c23153c9988a34445ed72dfbc5d4f2040dc6dde4539badd11cb8\">\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=\"Manage Positions - Polymarket Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Learn how to manage outcome-token inventory from creation through redemption.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://polymarket-292d1b1b.mintlify.app/_mintlify/api/og/v2?division=Positions\u0026amp;title=Manage+Positions\u0026amp;description=Learn+how+to+manage+outcome-token+inventory+from+creation+through+redemption.\u0026amp;theme=fa0d6f0cc421a55834d31ae9\u0026amp;signature=da4ec22d3d11c23153c9988a34445ed72dfbc5d4f2040dc6dde4539badd11cb8\">\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/polymarket-292d1b1b/A9bXCLxqYBPZ1NXc/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Polymarket Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#165DFC\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.com-polybet-q47.com/trading/positions/manage\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/trading/positions/manage.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.com-polybet-q47.com/trading/positions/manage\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh\" href=\"https://docs.com-polybet-q47.com/cn/trading/positions/manage\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.com-polybet-q47.com/trading/positions/manage\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.com-polybet-q47.com/#organization\",\"name\":\"Polymarket Documentation\",\"url\":\"https://docs.com-polybet-q47.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/polymarket-292d1b1b/ZibMe6Tli_amZald/logo/light.svg?fit=max\u0026auto=format\u0026n=ZibMe6Tli_amZald\u0026q=85\u0026s=9f9bd559f02181495794661ef6426c0f\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.com-polybet-q47.com#website\",\"name\":\"Polymarket Documentation\",\"url\":\"https://docs.com-polybet-q47.com\",\"publisher\":{\"@id\":\"https://docs.com-polybet-q47.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.com-polybet-q47.com/trading/positions/manage#webpage\",\"url\":\"https://docs.com-polybet-q47.com/trading/positions/manage\",\"name\":\"Manage Positions\",\"description\":\"Learn how to manage outcome-token inventory from creation through redemption.\",\"dateModified\":\"2026-10-05T14:01:26.405Z\",\"isPartOf\":{\"@id\":\"https://docs.com-polybet-q47.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.com-polybet-q47.com/trading/positions/manage#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.com-polybet-q47.com/trading/positions/manage#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Trading\",\"item\":\"https://docs.com-polybet-q47.com/trading/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Positions\",\"item\":\"https://docs.com-polybet-q47.com/trading/positions/how-positions-work\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Manage Positions\",\"item\":\"https://docs.com-polybet-q47.com/trading/positions/manage\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.com-polybet-q47.com/trading/positions/manage#article\",\"headline\":\"Manage Positions\",\"name\":\"Manage Positions\",\"description\":\"Learn how to manage outcome-token inventory from creation through redemption.\",\"url\":\"https://docs.com-polybet-q47.com/trading/positions/manage\",\"mainEntityOfPage\":{\"@id\":\"https://docs.com-polybet-q47.com/trading/positions/manage#webpage\"},\"dateModified\":\"2026-10-05T14:01:26.405Z\",\"publisher\":{\"@id\":\"https://docs.com-polybet-q47.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.com-polybet-q47.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Polymarket Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Polymarket Documentation","nav":{"global":null,"languages":[{"language":"en","banner":{"content":"Data API v2 is live. Data API v1 is retired on October 24, 2026 — see the [migration guide](/migrate/data-api-v1-to-v2).","dismissible":true},"tabs":[{"tab":"Predictions","groups":[{"group":"Getting Started","icon":"https://mintlify.s3.us-west-1.amazonaws.com/polymarket-292d1b1b/images/icons/nav/book.svg","pages":[{"title":"Overview","mode":"frame","href":""},{"title":"Polymarket 101","href":"/polymarket-101"},{"group":"SDKs \u0026 APIs","root":{"title":"SDKs \u0026 APIs","href":"/getting-started/sdks-apis"},"pages":[{"title":"TypeScript SDK","href":"/getting-started/typescript"},{"title":"Python SDK","href":"/getting-started/python"},{"title":"API","href":"/getting-started/api"}]}]},{"group":"Core Concepts","icon":"https://mintlify.s3.us-west-1.amazonaws.com/polymarket-292d1b1b/images/icons/nav/layers.svg","pages":[{"title":"Markets \u0026 Events","href":"/concepts/markets-events"},{"title":"Positions \u0026 Tokens","href":"/concepts/positions-tokens"},{"title":"Negative Risk Markets","href":"/concepts/negative-risk"},{"title":"Prices \u0026 Orderbook","href":"/concepts/prices-orderbook"},{"title":"Polymarket USD","href":"/concepts/pusd"},{"title":"Order Lifecycle","href":"/concepts/order-lifecycle"},{"title":"Resolution","href":"/concepts/resolution"}]},{"group":"Market Data","icon":"https://mintlify.s3.us-west-1.amazonaws.com/polymarket-292d1b1b/images/icons/nav/paper.svg","pages":[{"title":"Overview","href":"/market-data/overview"},{"title":"Discover Markets","href":"/market-data/discover-markets"},{"title":"Market Details","href":"/market-data/market-details"},{"title":"Prices and Order Books","href":"/market-data/prices-order-books"},{"title":"Analytics","href":"/market-data/public-analytics"},{"title":"Real-Time Data","href":"/market-data/realtime-data"}]},{"group":"Trading","icon":"https://mintlify.s3.us-west-1.amazonaws.com/polymarket-292d1b1b/images/icons/nav/chart.svg","pages":[{"title":"Overview","href":"/trading/overview"},{"title":"Place Your First Order","href":"/trading/quickstart"},{"title":"Wallets and Authentication","href":"/trading/wallets-auth"},{"title":"Session Keys","tag":"Beta","href":"/trading/session-keys"},{"title":"Place Orders","href":"/trading/place-orders"},{"title":"Manage Orders","href":"/trading/manage-orders"},{"title":"Real-Time Order Updates","href":"/trading/realtime-order-updates"},{"group":"Positions","pages":[{"title":"How Positions Work","description":"Understand Polymarket outcome positions, ledgers, and identifiers.","href":"/trading/positions/how-positions-work"},{"title":"Manage Positions","href":"/trading/positions/manage"},{"title":"Combinatorial Positions","description":"Multi-leg positions built from existing Polymarket outcomes","href":"/trading/positions/combinatorial"}]},{"group":"Combos","pages":[{"title":"How Combos Work","mode":"wide","href":"/trading/combos/overview"},{"title":"Requesters","tag":"New","href":"/trading/combos/requesters"},{"title":"Market Makers","href":"/trading/combos/market-makers"},{"title":"Combos for Builders","tag":"New","href":"/trading/combos/builders"},{"title":"Collateral Return","tag":"New","href":"/trading/combos/collateral-return"}]},{"title":"Wallet Activity","href":"/trading/wallet-activity"},{"title":"Fees","href":"/trading/fees"},{"title":"Market Making","href":"/trading/market-making"},{"title":"Matching Engine Restarts","href":"/trading/matching-engine"},{"group":"Bridge","pages":[{"title":"Deposit","href":"/trading/bridge/deposit"},{"title":"Supported Assets","href":"/trading/bridge/supported-assets"},{"title":"Quote","href":"/trading/bridge/quote"},{"title":"Withdraw","href":"/trading/bridge/withdraw"},{"title":"Transaction Status","href":"/trading/bridge/status"}]}]},{"group":"Programs","icon":"https://mintlify.s3.us-west-1.amazonaws.com/polymarket-292d1b1b/images/icons/nav/trophy.svg","pages":[{"title":"Taker Rebate Program","href":"/programs/taker-rebates"},{"title":"Maker Rebates Program","href":"/programs/maker-rebates"},{"title":"Liquidity Rewards","href":"/programs/liquidity-rewards"},{"group":"Builder Program","pages":[{"title":"Overview","href":"/programs/builders/overview"},{"title":"Builder Fees","href":"/programs/builders/fees"},{"title":"Tiers","href":"/programs/builders/tiers"}]},{"title":"Referral Program","href":"/programs/referral-program"}]},{"group":"Migration Guides","icon":"https://mintlify.s3.us-west-1.amazonaws.com/polymarket-292d1b1b/images/icons/nav/compass.svg","pages":[{"group":"Protocol V2 Migration","pages":[{"title":"Migrate to Polymarket Protocol V2","sidebarTitle":"Overview","href":"/migrate/polymarket-v2/overview"},{"title":"Polymarket Protocol V2 API Migration","sidebarTitle":"API Integrations","href":"/migrate/polymarket-v2/api-integrations"},{"title":"Polymarket Protocol V2 SDK Migration","sidebarTitle":"SDK Integrations","href":"/migrate/polymarket-v2/sdk-integrations"},{"title":"Polymarket Protocol V2 Contract Migration","sidebarTitle":"Contract Integrations","href":"/migrate/polymarket-v2/contract-integrations"}]},{"title":"Migrate from Data API v1 to v2","href":"/migrate/data-api-v1-to-v2"},{"title":"Migrate from Legacy SDKs to Unified SDKs","href":"/migrate/clob-sdk-to-unified-sdk"},{"title":"Migrate from RTDS to PolyBolt","href":"/migrate/rtds-to-polybolt"}]},{"group":"Resources","icon":"https://mintlify.s3.us-west-1.amazonaws.com/polymarket-292d1b1b/images/icons/nav/book-search.svg","pages":[{"title":"Contracts","href":"/resources/contracts"},{"title":"Onchain Position Data","href":"/resources/onchain-position-data"},{"title":"Data Resources","href":"/resources/blockchain-data"},{"title":"Error Codes","href":"/resources/error-codes"}]}]},{"tab":"Perps","pages":[{"title":"Perps","href":"/perps/overview"}]},{"tab":"API Reference","dropdowns":[{"dropdown":"Predictions","icon":"chart-pie","pages":[{"title":"Overview","href":"/api-reference/predictions/overview"},{"title":"Rate Limits","href":"/api-reference/rate-limits"},{"title":"CLOB Trading Rate Limits","href":"/api-reference/trading-rate-limits"},{"title":"Get rate limit tier","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /v1/user/rate-limit-tier","href":"/api-reference/account/get-rate-limit-tier"},{"title":"Geographic Restrictions","href":"/api-reference/geoblock"},{"title":"Get data freshness","deprecated":null,"version":null,"openapi":"https://pmdata.com-polybet-q47.com/v2/openapi.json get /v2/status","href":"/api-reference/service/get-data-freshness"},{"group":"Events","pages":[{"title":"List events (keyset pagination)","deprecated":null,"version":null,"openapi":"/api-spec/gamma-openapi.yaml get /events/keyset","href":"/api-reference/events/list-events-keyset-pagination"},{"title":"List events","deprecated":null,"version":null,"openapi":"/api-spec/gamma-openapi.yaml get /events","href":"/api-reference/events/list-events"},{"title":"Get event by id","deprecated":null,"version":null,"openapi":"/api-spec/gamma-openapi.yaml get /events/{id}","href":"/api-reference/events/get-event-by-id"},{"title":"Get event by slug","deprecated":null,"version":null,"openapi":"/api-spec/gamma-openapi.yaml get /events/slug/{slug}","href":"/api-reference/events/get-event-by-slug"},{"title":"Get event tags","deprecated":null,"version":null,"openapi":"/api-spec/gamma-openapi.yaml get /events/{id}/tags","href":"/api-reference/events/get-event-tags"}]},{"group":"Markets","pages":[{"title":"List markets (keyset pagination)","deprecated":null,"version":null,"openapi":"/api-spec/gamma-openapi.yaml get /markets/keyset","href":"/api-reference/markets/list-markets-keyset-pagination"},{"title":"List markets","deprecated":null,"version":null,"openapi":"/api-spec/gamma-openapi.yaml get /markets","href":"/api-reference/markets/list-markets"},{"title":"Get market by id","deprecated":null,"version":null,"openapi":"/api-spec/gamma-openapi.yaml get /markets/{id}","href":"/api-reference/markets/get-market-by-id"},{"title":"Get market by slug","deprecated":null,"version":null,"openapi":"/api-spec/gamma-openapi.yaml get /markets/slug/{slug}","href":"/api-reference/markets/get-market-by-slug"},{"title":"Get market tags by id","deprecated":null,"version":null,"openapi":"/api-spec/gamma-openapi.yaml get /markets/{id}/tags","href":"/api-reference/markets/get-market-tags-by-id"},{"title":"Get market by token","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /markets-by-token/{token_id}","href":"/api-reference/markets/get-market-by-token"},{"title":"List a market's top holders","deprecated":null,"version":null,"openapi":"https://pmdata.com-polybet-q47.com/v2/openapi.json get /v2/holders","href":"/api-reference/markets/list-a-markets-top-holders"},{"title":"Get open interest","deprecated":null,"version":null,"openapi":"https://pmdata.com-polybet-q47.com/v2/openapi.json get /v2/oi","href":"/api-reference/markets/get-open-interest"},{"title":"Get live volume for an event","deprecated":null,"version":null,"openapi":"https://pmdata.com-polybet-q47.com/v2/openapi.json get /v2/live-volume","href":"/api-reference/markets/get-live-volume-for-an-event"},{"title":"Get resolution state","deprecated":null,"version":null,"openapi":"https://pmdata.com-polybet-q47.com/v2/openapi.json get /v2/resolutions","href":"/api-reference/markets/get-resolution-state"},{"title":"Look up tokens","deprecated":null,"version":null,"openapi":"https://pmdata.com-polybet-q47.com/v2/openapi.json get /v2/tokens","href":"/api-reference/markets/look-up-tokens"},{"title":"Get simplified markets","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /simplified-markets","href":"/api-reference/markets/get-simplified-markets"},{"title":"Get sampling markets","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /sampling-markets","href":"/api-reference/markets/get-sampling-markets"},{"title":"Get sampling simplified markets","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /sampling-simplified-markets","href":"/api-reference/markets/get-sampling-simplified-markets"}]},{"group":"Orderbook \u0026 Pricing","pages":[{"title":"Get order book","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /book","href":"/api-reference/market-data/get-order-book"},{"title":"Get order books (request body)","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml post /books","href":"/api-reference/market-data/get-order-books-request-body"},{"title":"Get market price","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /price","href":"/api-reference/market-data/get-market-price"},{"title":"Get market prices (query parameters)","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /prices","href":"/api-reference/market-data/get-market-prices-query-parameters"},{"title":"Get market prices (request body)","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml post /prices","href":"/api-reference/market-data/get-market-prices-request-body"},{"title":"Get midpoint price","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /midpoint","href":"/api-reference/data/get-midpoint-price"},{"title":"Get midpoint prices (query parameters)","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /midpoints","href":"/api-reference/market-data/get-midpoint-prices-query-parameters"},{"title":"Get midpoint prices (request body)","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml post /midpoints","href":"/api-reference/market-data/get-midpoint-prices-request-body"},{"title":"Get spread","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /spread","href":"/api-reference/market-data/get-spread"},{"title":"Get spreads","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml post /spreads","href":"/api-reference/market-data/get-spreads"},{"title":"Get last trade price","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /last-trade-price","href":"/api-reference/market-data/get-last-trade-price"},{"title":"Get last trade prices (query parameters)","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /last-trades-prices","href":"/api-reference/market-data/get-last-trade-prices-query-parameters"},{"title":"Get last trade prices (request body)","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml post /last-trades-prices","href":"/api-reference/market-data/get-last-trade-prices-request-body"},{"title":"Get prices history","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /prices-history","href":"/api-reference/markets/get-prices-history"},{"title":"Get a token's price history","deprecated":null,"version":null,"openapi":"https://pmdata.com-polybet-q47.com/v2/openapi.json get /v2/prices-history","href":"/api-reference/markets/get-a-tokens-price-history"},{"title":"Get batch prices history","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml post /batch-prices-history","href":"/api-reference/markets/get-batch-prices-history"},{"title":"Get fee rate","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /fee-rate","href":"/api-reference/market-data/get-fee-rate"},{"title":"Get fee rate by path parameter","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /fee-rate/{token_id}","href":"/api-reference/market-data/get-fee-rate-by-path-parameter"},{"title":"Get tick size","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /tick-size","href":"/api-reference/market-data/get-tick-size"},{"title":"Get tick size by path parameter","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /tick-size/{token_id}","href":"/api-reference/market-data/get-tick-size-by-path-parameter"},{"title":"Get CLOB market info","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /clob-markets/{condition_id}","href":"/api-reference/markets/get-clob-market-info"},{"title":"Get server time","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /time","href":"/api-reference/data/get-server-time"}]},{"group":"Orders","pages":[{"title":"Post a new order","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml post /order","href":"/api-reference/trade/post-a-new-order"},{"title":"Cancel single order","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml delete /order","href":"/api-reference/trade/cancel-single-order"},{"title":"Get single order by ID","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /data/order/{orderID}","href":"/api-reference/trade/get-single-order-by-id"},{"title":"Post multiple orders","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml post /orders","href":"/api-reference/trade/post-multiple-orders"},{"title":"Get user orders","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /data/orders","href":"/api-reference/trade/get-user-orders"},{"title":"Cancel multiple orders","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml delete /orders","href":"/api-reference/trade/cancel-multiple-orders"},{"title":"Cancel all orders","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml delete /cancel-all","href":"/api-reference/trade/cancel-all-orders"},{"title":"Cancel orders for a market","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml delete /cancel-market-orders","href":"/api-reference/trade/cancel-orders-for-a-market"},{"title":"Get order scoring status","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /order-scoring","href":"/api-reference/trade/get-order-scoring-status"},{"title":"Send heartbeat","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml post /heartbeats","href":"/api-reference/trade/send-heartbeat"}]},{"group":"Trades","pages":[{"title":"List trades","deprecated":null,"version":null,"openapi":"https://pmdata.com-polybet-q47.com/v2/openapi.json get /v2/trades","href":"/api-reference/feeds/list-trades"},{"title":"Get trades","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /data/trades","href":"/api-reference/trade/get-trades"},{"title":"Get builder trades","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /builder/trades","href":"/api-reference/trade/get-builder-trades"}]},{"group":"Rebates","pages":[{"title":"Get current rebated fees for a maker","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /rebates/current","href":"/api-reference/rebates/get-current-rebated-fees-for-a-maker"}]},{"group":"Rewards","pages":[{"title":"Get current active rewards configurations","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /rewards/markets/current","href":"/api-reference/rewards/get-current-active-rewards-configurations"},{"title":"Get raw rewards for a specific market","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /rewards/markets/{condition_id}","href":"/api-reference/rewards/get-raw-rewards-for-a-specific-market"},{"title":"Get multiple markets with rewards","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /rewards/markets/multi","href":"/api-reference/rewards/get-multiple-markets-with-rewards"},{"title":"Get earnings for user by date","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /rewards/user","href":"/api-reference/rewards/get-earnings-for-user-by-date"},{"title":"Get total earnings for user by date","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /rewards/user/total","href":"/api-reference/rewards/get-total-earnings-for-user-by-date"},{"title":"Get reward percentages for user","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /rewards/user/percentages","href":"/api-reference/rewards/get-reward-percentages-for-user"},{"title":"Get user earnings and markets configuration","deprecated":null,"version":null,"openapi":"/api-spec/clob-openapi.yaml get /rewards/user/markets","href":"/api-reference/rewards/get-user-earnings-and-markets-configuration"}]},{"group":"Profile","pages":[{"title":"Get public profile by wallet address","deprecated":null,"version":null,"openapi":"/api-spec/gamma-openapi.yaml get /public-profile","href":"/api-reference/profiles/get-public-profile-by-wallet-address"},{"title":"Get a user's profile stats","deprecated":null,"version":null,"openapi":"https://pmdata.com-polybet-q47.com/v2/openapi.json get /v2/user-stats","href":"/api-reference/wallet/get-a-users-profile-stats"},{"title":"List positions for a user or market","deprecated":null,"version":null,"openapi":"https://pmdata.com-polybet-q47.com/v2/openapi.json get /v2/positions","href":"/api-reference/wallet/list-positions-for-a-user-or-market"},{"title":"Get portfolio value","deprecated":null,"version":null,"openapi":"https://pmdata.com-polybet-q47.com/v2/openapi.json get /v2/value","href":"/api-reference/wallet/get-portfolio-value"},{"title":"Get a user's PnL series","deprecated":null,"version":null,"openapi":"https://pmdata.com-polybet-q47.com/v2/openapi.json get /v2/user-pnl","href":"/api-reference/wallet/get-a-users-pnl-series"},{"title":"Get a user's trading volume","deprecated":null,"version":null,"openapi":"https://pmdata.com-polybet-q47.com/v2/openapi.json get /v2/user-volume","href":"/api-reference/wallet/get-a-users-trading-volume"},{"title":"List account activity","deprecated":null,"version":null,"openapi":"https://pmdata.com-polybet-q47.com/v2/openapi.json get /v2/activity","href":"/api-reference/feeds/list-account-activity"},{"title":"Get wallet approvals","deprecated":null,"version":null,"openapi":"https://pmdata.com-polybet-q47.com/v2/openapi.json get /v2/approvals","href":"/api-reference/wallet/get-wallet-approvals"}]},{"group":"Boards","pages":[{"title":"Get the trader leaderboard","deprecated":null,"version":null,"openapi":"https://pmdata.com-polybet-q47.com/v2/openapi.json get /v2/leaderboard","href":"/api-reference/boards/get-the-trader-leaderboard"},{"title":"List the biggest wins","deprecated":null,"version":null,"openapi":"https://pmdata.com-polybet-q47.com/v2/openapi.json get /v2/biggest-winners","href":"/api-reference/boards/list-the-biggest-wins"},{"title":"Get the builders leaderboard","deprecated":null,"version":null,"openapi":"https://pmdata.com-polybet-q47.com/v2/openapi.json get /v2/builders/leaderboard","href":"/api-reference/boards/get-the-builders-leaderboard"},{"title":"Get builder volume over time","deprecated":null,"version":null,"openapi":"https://pmdata.com-polybet-q47.com/v2/openapi.json get /v2/builders/volume","href":"/api-reference/boards/get-builder-volume-over-time"}]},{"group":"Search","pages":[{"title":"Search markets, events, and profiles","deprecated":null,"version":null,"openapi":"/api-spec/gamma-openapi.yaml get /public-search","href":"/api-reference/search/search-markets-events-and-profiles"}]},{"group":"Tags","pages":[{"title":"List tags","deprecated":null,"version":null,"openapi":"/api-spec/gamma-openapi.yaml get /tags","href":"/api-reference/tags/list-tags"},{"title":"Get tag by id","deprecated":null,"version":null,"openapi":"/api-spec/gamma-openapi.yaml get /tags/{id}","href":"/api-reference/tags/get-tag-by-id"},{"title":"Get tag by slug","deprecated":null,"version":null,"openapi":"/api-spec/gamma-openapi.yaml get /tags/slug/{slug}","href":"/api-reference/tags/get-tag-by-slug"},{"title":"Get related tags (relationships) by tag id","deprecated":null,"version":null,"openapi":"/api-spec/gamma-openapi.yaml get /tags/{id}/related-tags","href":"/api-reference/tags/get-related-tags-relationships-by-tag-id"},{"title":"Get related tags (relationships) by tag slug","deprecated":null,"version":null,"openapi":"/api-spec/gamma-openapi.yaml get /tags/slug/{slug}/related-tags","href":"/api-reference/tags/get-related-tags-relationships-by-tag-slug"},{"title":"Get tags related to a tag id","deprecated":null,"version":null,"openapi":"/api-spec/gamma-openapi.yaml get /tags/{id}/related-tags/tags","href":"/api-reference/tags/get-tags-related-to-a-tag-id"},{"title":"Get tags related to a tag slug","deprecated":null,"version":null,"openapi":"/api-spec/gamma-openapi.yaml get /tags/slug/{slug}/related-tags/tags","href":"/api-reference/tags/get-tags-related-to-a-tag-slug"}]},{"group":"Series","pages":[{"title":"List series","deprecated":null,"version":null,"openapi":"/api-spec/gamma-openapi.yaml get /series","href":"/api-reference/series/list-series"},{"title":"Get series by id","deprecated":null,"version":null,"openapi":"/api-spec/gamma-openapi.yaml get /series/{id}","href":"/api-reference/series/get-series-by-id"}]},{"group":"Comments","pages":[{"title":"List comments","deprecated":null,"version":null,"openapi":"/api-spec/gamma-openapi.yaml get /comments","href":"/api-reference/comments/list-comments"},{"title":"Get comments by comment id","deprecated":null,"version":null,"openapi":"/api-spec/gamma-openapi.yaml get /comments/{id}","href":"/api-reference/comments/get-comments-by-comment-id"},{"title":"Get comments by user address","deprecated":null,"version":null,"openapi":"/api-spec/gamma-openapi.yaml get /comments/user_address/{user_address}","href":"/api-reference/comments/get-comments-by-user-address"}]},{"group":"Sports","pages":[{"title":"Get sports metadata information","deprecated":null,"version":null,"openapi":"/api-spec/gamma-openapi.yaml get /sports","href":"/api-reference/sports/get-sports-metadata-information"},{"title":"Get valid sports market types","deprecated":null,"version":null,"openapi":"/api-spec/gamma-openapi.yaml get /sports/market-types","href":"/api-reference/sports/get-valid-sports-market-types"},{"title":"List teams","deprecated":null,"version":null,"openapi":"/api-spec/gamma-openapi.yaml get /teams","href":"/api-reference/sports/list-teams"}]},{"group":"Relayer","pages":[{"title":"Submit a transaction","deprecated":null,"version":null,"openapi":"/api-spec/relayer-openapi.yaml post /submit","href":"/api-reference/relayer/submit-a-transaction"},{"title":"Get a transaction by ID","deprecated":null,"version":null,"openapi":"/api-spec/relayer-openapi.yaml get /transaction","href":"/api-reference/relayer/get-a-transaction-by-id"},{"title":"Get recent transactions for a user","deprecated":null,"version":null,"openapi":"/api-spec/relayer-openapi.yaml get /transactions","href":"/api-reference/relayer/get-recent-transactions-for-a-user"},{"title":"Get current nonce for a user","deprecated":null,"version":null,"openapi":"/api-spec/relayer-openapi.yaml get /nonce","href":"/api-reference/relayer/get-current-nonce-for-a-user"},{"title":"Get relayer address and nonce","deprecated":null,"version":null,"openapi":"/api-spec/relayer-openapi.yaml get /relay-payload","href":"/api-reference/relayer/get-relayer-address-and-nonce"},{"title":"Check if a wallet is deployed","deprecated":null,"version":null,"openapi":"/api-spec/relayer-openapi.yaml get /deployed","href":"/api-reference/relayer/check-if-a-wallet-is-deployed"},{"title":"Get all relayer API keys","deprecated":null,"version":null,"openapi":"/api-spec/relayer-openapi.yaml get /relayer/api/keys","href":"/api-reference/relayer-api-keys/get-all-relayer-api-keys"}]},{"group":"Combos","tag":"New","pages":[{"title":"Get combo markets","deprecated":null,"version":null,"openapi":"/api-spec/combos-rfq-openapi.yaml get /v1/rfq/combo-markets","href":"/api-reference/combo-markets/get-combo-markets"},{"title":"Submit a quote","deprecated":null,"version":null,"openapi":"/api-spec/combos-rfq-openapi.yaml post /v1/maker/quotes","href":"/api-reference/maker/submit-a-quote"},{"title":"Cancel a quote","deprecated":null,"version":null,"openapi":"/api-spec/combos-rfq-openapi.yaml post /v1/maker/quotes/cancel","href":"/api-reference/maker/cancel-a-quote"},{"title":"Confirm or decline last look","deprecated":null,"version":null,"openapi":"/api-spec/combos-rfq-openapi.yaml post /v1/maker/confirmations","href":"/api-reference/maker/confirm-or-decline-last-look"},{"title":"List combo positions","deprecated":null,"version":null,"openapi":"https://pmdata.com-polybet-q47.com/v2/openapi.json get /v2/positions/combos","href":"/api-reference/wallet/list-combo-positions"},{"title":"List combo activity","deprecated":null,"version":null,"openapi":"https://pmdata.com-polybet-q47.com/v2/openapi.json get /v2/activity/combos","href":"/api-reference/feeds/list-combo-activity"},{"title":"Quoter Gateway","asyncapi":"asyncapi-rfq.json quoter","href":"/api-reference/wss/rfq"}]},{"group":"WebSocket","pages":[{"title":"Market Channel","asyncapi":"asyncapi.json market","href":"/api-reference/wss/market"},{"title":"User Channel","asyncapi":"asyncapi-user.json user","href":"/api-reference/wss/user"},{"title":"Sports Channel","asyncapi":"asyncapi-sports.json sports","href":"/api-reference/wss/sports"}]},{"group":"PolyBolt WebSocket","tag":"New","pages":[{"title":"PolyBolt WebSocket","href":"/api-reference/live-data/overview"},{"title":"Live Data Channel","asyncapi":"https://ws-live-v2.polymarket.com/asyncapi.json ws","href":"/api-reference/wss/polybolt"},{"group":"Websockets","pages":[{"asyncapi":"https://ws-live-v2.polymarket.com/asyncapi.json ws","href":"/api-reference/websockets/live-data-channel","title":"Live Data Channel","version":null}]}]},{"group":"Bridge","pages":[{"title":"Get supported assets","deprecated":null,"version":null,"openapi":"/api-spec/bridge-openapi.yaml get /supported-assets","href":"/api-reference/bridge/get-supported-assets"},{"title":"Create bridge addresses","deprecated":null,"version":null,"openapi":"/api-spec/bridge-openapi.yaml post /deposit","href":"/api-reference/bridge/create-bridge-addresses"},{"title":"Get a quote","deprecated":null,"version":null,"openapi":"/api-spec/bridge-openapi.yaml post /quote","href":"/api-reference/bridge/get-a-quote"},{"title":"Get transaction status","deprecated":null,"version":null,"openapi":"/api-spec/bridge-openapi.yaml get /status/{address}","href":"/api-reference/bridge/get-transaction-status"},{"title":"Create withdrawal addresses","deprecated":null,"version":null,"openapi":"/api-spec/bridge-openapi.yaml post /withdraw","href":"/api-reference/bridge/create-withdrawal-addresses"}]},{"group":"Data API v1 (Legacy)","pages":[{"title":"Get current positions for a user","deprecated":null,"version":null,"openapi":"/api-spec/data-openapi.yaml get /positions","href":"/api-reference/core/get-current-positions-for-a-user"},{"title":"Get closed positions for a user","deprecated":null,"version":null,"openapi":"/api-spec/data-openapi.yaml get /closed-positions","href":"/api-reference/core/get-closed-positions-for-a-user"},{"title":"Get positions for a market","deprecated":null,"version":null,"openapi":"/api-spec/data-openapi.yaml get /v1/market-positions","href":"/api-reference/core/get-positions-for-a-market"},{"title":"Get trades for a user or markets","deprecated":null,"version":null,"openapi":"/api-spec/data-openapi.yaml get /trades","href":"/api-reference/core/get-trades-for-a-user-or-markets"},{"title":"Get user activity","deprecated":null,"version":null,"openapi":"/api-spec/data-openapi.yaml get /activity","href":"/api-reference/core/get-user-activity"},{"title":"Get total value of a user's positions","deprecated":null,"version":null,"openapi":"/api-spec/data-openapi.yaml get /value","href":"/api-reference/core/get-total-value-of-a-users-positions"},{"title":"Get total markets a user has traded","deprecated":null,"version":null,"openapi":"/api-spec/data-openapi.yaml get /traded","href":"/api-reference/misc/get-total-markets-a-user-has-traded"},{"title":"Download an accounting snapshot (ZIP of CSVs)","deprecated":null,"version":null,"openapi":"/api-spec/data-openapi.yaml get /v1/accounting/snapshot","href":"/api-reference/misc/download-an-accounting-snapshot-zip-of-csvs"},{"title":"Get top holders for markets","deprecated":null,"version":null,"openapi":"/api-spec/data-openapi.yaml get /holders","href":"/api-reference/core/get-top-holders-for-markets"},{"title":"Get open interest","deprecated":null,"version":null,"openapi":"/api-spec/data-openapi.yaml get /oi","href":"/api-reference/misc/get-open-interest"},{"title":"Get live volume for an event","deprecated":null,"version":null,"openapi":"/api-spec/data-openapi.yaml get /live-volume","href":"/api-reference/misc/get-live-volume-for-an-event"},{"title":"Get trader leaderboard rankings","deprecated":null,"version":null,"openapi":"/api-spec/data-openapi.yaml get /v1/leaderboard","href":"/api-reference/core/get-trader-leaderboard-rankings"},{"title":"Get aggregated builder leaderboard","deprecated":null,"version":null,"openapi":"/api-spec/data-openapi.yaml get /v1/builders/leaderboard","href":"/api-reference/builders/get-aggregated-builder-leaderboard"},{"title":"Get daily builder volume time-series","deprecated":null,"version":null,"openapi":"/api-spec/data-openapi.yaml get /v1/builders/volume","href":"/api-reference/builders/get-daily-builder-volume-time-series"},{"title":"Get user combo positions","deprecated":null,"version":null,"openapi":"/api-spec/data-openapi.yaml get /v1/positions/combos","href":"/api-reference/core/get-user-combo-positions"},{"title":"Get user combo activity","deprecated":null,"version":null,"openapi":"/api-spec/data-openapi.yaml get /v1/activity/combos","href":"/api-reference/core/get-user-combo-activity"}]},{"title":"Data API v2","href":"/api-reference/data-api/overview"}]},{"dropdown":"Perps","icon":"chart-line","pages":[{"title":"Overview","href":"/api-reference/perps/overview"},{"title":"Rate Limits","href":"/api-reference/perps/rate-limits"},{"title":"Geographic Restrictions","href":"/api-reference/perps/geographic-restrictions"},{"group":"HTTP","pages":[{"title":"Test Connection","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/ping","href":"/api-reference/test-connection"},{"title":"Get Server Time","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/time","href":"/api-reference/get-server-time"},{"title":"Get Exchange Info","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/exchange","href":"/api-reference/get-exchange-info"},{"title":"Get Collateral Assets","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/assets","href":"/api-reference/get-collateral-assets"},{"title":"Get Instruments","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/instruments","href":"/api-reference/get-instruments"},{"title":"Get Tickers","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/tickers","href":"/api-reference/get-tickers"},{"title":"Get Statistics","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/statistics","href":"/api-reference/get-statistics"},{"title":"Get Exchange Statistics","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/exchange-stats","href":"/api-reference/get-exchange-statistics"},{"title":"Get Leaderboard","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/leaderboard","href":"/api-reference/get-leaderboard"},{"title":"Get Trading Competitions","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/competitions","href":"/api-reference/get-trading-competitions"},{"title":"Get Trading Competition","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/competition","href":"/api-reference/get-trading-competition"},{"title":"Get Trading Competition Leaderboard","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/competition/leaderboard","href":"/api-reference/get-trading-competition-leaderboard"},{"title":"Get Trading Competition Account","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/competition/account","href":"/api-reference/get-trading-competition-account"},{"title":"Get Trading Competition Widget","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/competition/widget","href":"/api-reference/get-trading-competition-widget"},{"title":"Get Klines","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/klines","href":"/api-reference/get-klines"},{"title":"Get Mark Price History","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/mark-history","href":"/api-reference/get-mark-price-history"},{"title":"Get BBO","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/bbo","href":"/api-reference/get-bbo"},{"title":"Get Book","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/book","href":"/api-reference/get-book"},{"title":"Get Index","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/index","href":"/api-reference/get-index"},{"title":"Get Recent Trades","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/trades","href":"/api-reference/get-recent-trades"},{"title":"Get Public Portfolio","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/portfolio","href":"/api-reference/get-public-portfolio"},{"title":"Get Current Position Fills","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/position-fills","href":"/api-reference/get-current-position-fills"},{"title":"Get Position Share Card Snapshots","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json post /v1/info/position-snapshots","href":"/api-reference/get-position-share-card-snapshots"},{"title":"Get Historical Funding","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/funding","href":"/api-reference/get-historical-funding"},{"title":"Get Fees","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/fees","href":"/api-reference/get-fees"},{"title":"Get builder profile and eligibility","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/builder","href":"/api-reference/get-builder-profile-and-eligibility"},{"title":"Approve or revoke builder fees with an account owner signature","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json post /v1/account/builder-approvals","href":"/api-reference/approve-or-revoke-builder-fees-with-an-account-owner-signature"},{"title":"Read builder approvals, including retained revoked versions","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/account/builder-approvals","href":"/api-reference/read-builder-approvals-including-retained-revoked-versions"},{"title":"Get authenticated builder receipts","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/account/builder-earnings","href":"/api-reference/get-authenticated-builder-receipts"},{"title":"Get authenticated builder settled earnings summary","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/account/builder-earnings-summary","href":"/api-reference/get-authenticated-builder-settled-earnings-summary"},{"title":"Get Limit Tiers","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/limit-tiers","href":"/api-reference/get-limit-tiers"},{"title":"Check Invite Code","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/invite","href":"/api-reference/check-invite-code"},{"title":"Get Registration","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/info/registered","href":"/api-reference/get-registration"},{"title":"Create Orders","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json post /v1/trade/orders","href":"/api-reference/create-orders"},{"title":"Modify Orders","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json patch /v1/trade/orders","href":"/api-reference/modify-orders"},{"title":"Modify Orders COID","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json patch /v1/trade/orders-coid","href":"/api-reference/modify-orders-coid"},{"title":"Cancel Orders","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json delete /v1/trade/orders","href":"/api-reference/cancel-orders"},{"title":"Cancel Orders COID","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json delete /v1/trade/orders-coid","href":"/api-reference/cancel-orders-coid"},{"title":"Cancel All Orders","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json delete /v1/trade/orders/all","href":"/api-reference/cancel-all-orders"},{"title":"Set Auto-Cancel","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json patch /v1/trade/auto-cancel","href":"/api-reference/set-auto-cancel"},{"title":"Update Leverage","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json patch /v1/trade/leverage","href":"/api-reference/update-leverage"},{"title":"Update Leverage for Multiple Instruments","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json patch /v1/trade/leverage/batch","href":"/api-reference/update-leverage-for-multiple-instruments"},{"title":"Update Isolated Margin","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json patch /v1/trade/margin","href":"/api-reference/update-isolated-margin"},{"title":"Update your builder display name","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json patch /v1/account/builder","href":"/api-reference/update-your-builder-display-name"},{"title":"Create Proxy","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json post /v1/account/proxy","href":"/api-reference/create-proxy"},{"title":"Delete Proxy","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json delete /v1/account/proxy","href":"/api-reference/delete-proxy"},{"title":"Get Credentials","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/account/credentials","href":"/api-reference/get-credentials"},{"title":"Get Orders","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/account/orders","href":"/api-reference/get-orders"},{"title":"Get Open Orders","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/account/open-orders","href":"/api-reference/get-open-orders"},{"title":"Get Balances","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/account/balances","href":"/api-reference/get-balances"},{"title":"Get Portfolio","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/account/portfolio","href":"/api-reference/get-portfolio"},{"title":"Get Fills","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/account/fills","href":"/api-reference/get-fills"},{"title":"Get Equity","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/account/equity","href":"/api-reference/get-equity"},{"title":"Get PnL","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/account/pnl","href":"/api-reference/get-pnl"},{"title":"Get Account Backstop Transfers","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/account/backstops","href":"/api-reference/get-account-backstop-transfers"},{"title":"Get Funding Charges","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/account/funding","href":"/api-reference/get-funding-charges"},{"title":"Withdraw","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json post /v1/account/withdraw","href":"/api-reference/withdraw"},{"title":"Internal Transfer","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json post /v1/account/internal-transfer","href":"/api-reference/internal-transfer"},{"title":"Get Deposits","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/account/deposits","href":"/api-reference/get-deposits"},{"title":"Get Internal Transfers","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/account/internal-transfers","href":"/api-reference/get-internal-transfers"},{"title":"Get Withdrawals","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/account/withdrawals","href":"/api-reference/get-withdrawals"},{"title":"Get Account Stats","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/account/stats","href":"/api-reference/get-account-stats"},{"title":"Get Account Limits","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/account/limits","href":"/api-reference/get-account-limits"},{"title":"Get Account Rewards","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/account/rewards","href":"/api-reference/get-account-rewards"},{"title":"Get Instrument Config","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/account/config","href":"/api-reference/get-instrument-config"},{"title":"Get Auto-Cancel Status","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/account/auto-cancel","href":"/api-reference/get-auto-cancel-status"},{"title":"Create Account Invite","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json post /v1/account/invite","href":"/api-reference/create-account-invite"},{"title":"Get Account Referral","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/account/referral","href":"/api-reference/get-account-referral"},{"title":"Apply Referral Code","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json post /v1/account/referral","href":"/api-reference/apply-referral-code"},{"title":"Get Notifications","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json get /v1/account/notifications","href":"/api-reference/get-notifications"},{"title":"Mark Notifications Read","deprecated":null,"version":null,"openapi":"/api-spec/perps-openapi.json post /v1/account/notifications/read","href":"/api-reference/mark-notifications-read"}]},{"group":"WebSocket","pages":[{"title":"Ping","asyncapi":"asyncapi-perps.json ping","href":"/api-reference/wss/perps-ping"},{"title":"Place Orders","asyncapi":"asyncapi-perps.json placeOrders","href":"/api-reference/wss/perps-place-orders"},{"title":"Modify Orders","asyncapi":"asyncapi-perps.json modifyOrders","href":"/api-reference/wss/perps-modify-orders"},{"title":"Modify Orders by Client Order ID","asyncapi":"asyncapi-perps.json modifyOrdersCOID","href":"/api-reference/wss/perps-modify-orders-coid"},{"title":"Cancel Orders","asyncapi":"asyncapi-perps.json cancelOrders","href":"/api-reference/wss/perps-cancel-orders"},{"title":"Cancel Orders by Client Order ID","asyncapi":"asyncapi-perps.json cancelOrdersCOID","href":"/api-reference/wss/perps-cancel-orders-coid"},{"title":"Cancel All Orders","asyncapi":"asyncapi-perps.json cancelAll","href":"/api-reference/wss/perps-cancel-all"},{"title":"Auto Cancel","asyncapi":"asyncapi-perps.json autoCancel","href":"/api-reference/wss/perps-auto-cancel"},{"title":"Update Leverage","asyncapi":"asyncapi-perps.json updateLeverage","href":"/api-reference/wss/perps-update-leverage"},{"title":"Update Leverages","asyncapi":"asyncapi-perps.json updateLeverages","href":"/api-reference/wss/perps-update-leverages"},{"title":"Update Isolated Margin","asyncapi":"asyncapi-perps.json updateMargin","href":"/api-reference/wss/perps-update-margin"},{"title":"Auth","asyncapi":"asyncapi-perps.json auth","href":"/api-reference/wss/perps-auth"},{"title":"Trades","asyncapi":"asyncapi-perps.json trades","href":"/api-reference/wss/perps-trades"},{"title":"BBO","asyncapi":"asyncapi-perps.json bbo","href":"/api-reference/wss/perps-bbo"},{"title":"Book","asyncapi":"asyncapi-perps.json book","href":"/api-reference/wss/perps-book"},{"title":"Klines","asyncapi":"asyncapi-perps.json klines","href":"/api-reference/wss/perps-klines"},{"title":"Tickers","asyncapi":"asyncapi-perps.json tickers","href":"/api-reference/wss/perps-tickers"},{"title":"Statistics","asyncapi":"asyncapi-perps.json statistics","href":"/api-reference/wss/perps-statistics"},{"title":"Fills","asyncapi":"asyncapi-perps.json fills","href":"/api-reference/wss/perps-fills"},{"title":"Builder Fills","asyncapi":"asyncapi-perps.json builderFills","href":"/api-reference/wss/perps-builder-fills"},{"title":"Orders","asyncapi":"asyncapi-perps.json orders","href":"/api-reference/wss/perps-orders"},{"title":"Funding","asyncapi":"asyncapi-perps.json funding","href":"/api-reference/wss/perps-funding"},{"title":"Balances","asyncapi":"asyncapi-perps.json balances","href":"/api-reference/wss/perps-balances"},{"title":"Portfolio","asyncapi":"asyncapi-perps.json portfolio","href":"/api-reference/wss/perps-portfolio"},{"title":"Deposits","asyncapi":"asyncapi-perps.json deposits","href":"/api-reference/wss/perps-deposits"},{"title":"Withdrawals","asyncapi":"asyncapi-perps.json withdrawals","href":"/api-reference/wss/perps-withdrawals"},{"title":"TP/SL","asyncapi":"asyncapi-perps.json tpsl","href":"/api-reference/wss/perps-tpsl"},{"title":"Notifications","asyncapi":"asyncapi-perps.json notifications","href":"/api-reference/wss/perps-notifications"}]}]}]},{"tab":"Changelogs","menu":[{"item":"Predictions","pages":[{"title":"Predictions","href":"/changelog/predictions"}]},{"item":"Perps","pages":[{"title":"Perps","href":"/changelog/perps"}]},{"item":"SDKs","pages":[{"title":"SDKs","href":"/changelog/sdks"}]}],"pages":[{"title":"Changelogs","href":"/changelog/predictions"}]}]},{"language":"cn","banner":{"content":"Data API v2 已上线。Data API v1 将于 2026 年 10 月 24 日停用,请参阅[迁移指南](/cn/migrate/data-api-v1-to-v2)。","dismissible":true},"pages":[{"title":"cn","href":"/cn/trading/positions/manage"}]}]},"title":"Manage Positions - Polymarket Documentation","buildId":"dpl_DFJrtvUi8HS5F9nkooKuDJsuD5BM","deploymentId":"dpl_DFJrtvUi8HS5F9nkooKuDJsuD5BM","dynamics":["10e4515597"],"chunks":["BannerMarkdown-BVNUlwBc.js","dist-aeztFa9U.js","lib--scc4DXi.js","lib-B8HbPgcC.js","clsx-rL8ZCCw4.js","html-void-elements-mCSPHezU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js"]}