Skip to main content
POST
/
workflows
/
polymarket
/
sellPosition
Sell Position
curl --request POST \
  --url https://api-v2.swaps.xyz/api/workflows/polymarket/sellPosition \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "evmEoa": "0xB9519a08267d7B259eCA6DbD8F7286B1f176A41f",
  "side": "SELL",
  "tokenID": "90234889617199443673709150877675264662915727532354468551650133547723659310093",
  "orderType": "FAK",
  "tickSize": "0.01",
  "negRisk": true,
  "amount": 2,
  "feeRateBps": 0,
  "slippage": 100
}
'
{
  "txId": "0xa66c86a47f4f81caae5d767e2d8a5a7def1a191d24eba5bd49f8767297cfe2e5",
  "orderResponse": {
    "success": true,
    "errorMsg": "",
    "orderID": "0xb9826fe87ddf21261eceaf513977cb5ea1ae31ac173210857c879cef936dfa2b",
    "transactionsHashes": [
      "0x39ac6726cf2cfb7814bdb2e04aeeea1d3bde2d1ce7e357f79a404cacb6984f35"
    ],
    "status": "matched",
    "takingAmount": "1.376",
    "makingAmount": "2"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.swaps.xyz/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-api-key
string
header
required

Limited demo key for API Reference: 5c951bc81da566bbd030ba8e20724063.

Body

application/json
evmEoa
string
required

EVM address (wallet address)

Pattern: ^0x[a-fA-F0-9]{40}$
side
enum<string>
required

Order side - must be SELL

Available options:
SELL
tokenID
string
required

Polymarket CLOB token ID of the position to sell

orderType
enum<string>
required

Order type - Fill-Or-Kill (FOK) or Fill-And-Kill (FAK) for market orders

Available options:
FOK,
FAK
tickSize
string
required

Tick size from the market details (e.g., '0.01')

negRisk
boolean
required

Negative risk flag from the market details

amount
number
required

Amount of tokens to sell (must be a positive number)

proxyWallet
string

Proxy wallet address (optional)

Pattern: ^0x[a-fA-F0-9]{40}$
feeRateBps
number

Fee rate in basis points (optional, defaults to 0)

slippage
number

Slippage tolerance in basis points (optional, defaults to 0)

dstToken
object

Optional destination token. When set, sale proceeds are swapped into this token (address + chainId) before delivery.

dstWalletAddress
string

Optional wallet that receives the proceeds. When set, expiration and signatureByEvmEoa become required — see the Polymarket Signing Guide.

Pattern: ^0x[a-fA-F0-9]{40}$
expiration
integer

Unix timestamp (seconds) when signatureByEvmEoa expires. Must be in the future and ≤ 300s ahead.

signatureByEvmEoa
string

EIP-712 signature by the EOA over the SellPosition typed data. Required when dstWalletAddress is set. See the Polymarket Signing Guide.

Pattern: ^0x[a-fA-F0-9]*$

Response

Position sold successfully

txId
string

Transaction ID

orderResponse
object