Skip to main content
POST /api/v1/market/place-order
Auth required: Yes Sells outcome tokens back to the APMM pool to receive base tokens (e.g., USDC). Uses the same endpoint as buying but with side: 2.
This endpoint uses side: 2 for selling. For buying, see Buy Tokens (Deposit).

Request Body

marketAddress
string
required
Prediction market contract address.
optionAddress
string
required
Option token to sell.
side
number
required
Must be 2 (sell/withdraw).
price
string
required
Price per token in base token units.
amount
string
required
Amount of option tokens to sell.
minReceiveAmount
string
required
Minimum base tokens to receive. Slippage protection — transaction reverts if actual output is below this.
deadline
string
required
Unix timestamp. Transaction reverts if not executed before this time.
userOperation
object
required
Signed ERC-4337 UserOperation. See Buy Tokens for full field documentation.

Example

curl -X POST "https://api-staging.promethex.market/api/v1/market/place-order" \
  -H "Authorization: Bearer $PRIVY_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "marketAddress": "0x1234...abcd",
    "optionAddress": "0xaaaa...1111",
    "side": 2,
    "price": "700000",
    "amount": "15000000",
    "minReceiveAmount": "10000000",
    "deadline": "1740000000",
    "userOperation": {
      "sender": "0x...",
      "nonce": "0x...",
      "initCode": "0x",
      "callData": "0x...",
      "callGasLimit": "0x...",
      "verificationGasLimit": "0x...",
      "preVerificationGas": "0x...",
      "maxFeePerGas": "0x...",
      "maxPriorityFeePerGas": "0x...",
      "paymasterAndData": "0x...",
      "signature": "0x..."
    }
  }'

Response

{
  "code": 0,
  "data": {
    "opHash": "0xabcdef...",
    "orderUuid": "order-789-012"
  }
}
opHash
string
UserOperation hash for tracking the transaction.
orderUuid
string
Internal order identifier.

Notes

  • You can only sell tokens you hold. The amount cannot exceed your position.
  • Selling removes tokens from the APMM pool and returns base tokens.
  • Price impact depends on pool liquidity — larger sells relative to pool size will have higher slippage.
  • Set minReceiveAmount appropriately to avoid unfavorable fills.
  • After confirmation, an SSE event user:position_changed is emitted.
Selling tokens in a market that is in settling or ended status is not allowed. Use Claim instead to redeem winning tokens after settlement.