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"
  }
}

Authorizations

x-api-key
string
header
required

Limited demo key for API Reference: 5c951bc81da566bbd030ba8e20724063.

Body

application/json
evmEoa
string
required

EVM address (wallet address)

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)

feeRateBps
number

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

slippage
number

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

Response

Position sold successfully

txId
string

Transaction ID

orderResponse
object