Skip to main content
POST
/
v2
/
markets
/
{id}
/
sell
curl -X POST https://api.pmx.trade/v2/markets/1/sell \
  -H "Content-Type: application/json" \
  -d '{
    "wallet": "7xKXabc123...",
    "side": "UP",
    "amount": 50000000
  }'
{
  "success": true,
  "data": {
    "transaction": "AQAAAAAAA...base64...",
    "quote": {
      "side": "YES",
      "action": "sell",
      "inputAmount": 50000000,
      "outputAmount": 32500000,
      "effectivePrice": 0.65,
      "priceImpactBps": 80,
      "tradeFee": 660000,
      "preOdds": { "yes": 0.65, "no": 0.35 },
      "postOdds": { "yes": 0.60, "no": 0.40 }
    }
  }
}
Returns an unsigned Solana transaction that the caller must sign locally and submit to the network. The API never holds private keys. Selling is only available in AMM mode markets. Pool mode markets don’t support selling before resolution.

Path parameters

id
integer
required
The market ID.

Request body

wallet
string
required
The seller’s Solana wallet address (public key).
side
string
required
Which outcome token to sell. Use the market’s ticker name (e.g. UP, DOWN, FLIP, NOFLIP). The canonical YES/NO values are also accepted.
amount
integer
required
Number of tokens to sell in raw units (6 decimals). Minimum: 100,000.

Response

success
boolean
data
object
curl -X POST https://api.pmx.trade/v2/markets/1/sell \
  -H "Content-Type: application/json" \
  -d '{
    "wallet": "7xKXabc123...",
    "side": "UP",
    "amount": 50000000
  }'
{
  "success": true,
  "data": {
    "transaction": "AQAAAAAAA...base64...",
    "quote": {
      "side": "YES",
      "action": "sell",
      "inputAmount": 50000000,
      "outputAmount": 32500000,
      "effectivePrice": 0.65,
      "priceImpactBps": 80,
      "tradeFee": 660000,
      "preOdds": { "yes": 0.65, "no": 0.35 },
      "postOdds": { "yes": 0.60, "no": 0.40 }
    }
  }
}
The side parameter accepts the market’s custom ticker names. For example, if a market uses UP/DOWN tickers, pass "side": "UP" or "side": "DOWN". You can also always use the canonical YES/NO.
If you attempt to sell on a non-active market (resolved, cancelled), you’ll receive a 409 Conflict response including marketStatus and winningSide (if resolved) so you can handle it without a separate API call.
{
  "success": false,
  "error": "Market is resolved, not active. Cannot trade.",
  "marketStatus": "resolved",
  "winningSide": "YES"
}