Signature
client.sell(
token_id: str,
shares: float = None,
price: float = None,
usdc_amount: float = None,
order_type: str = "GTC"
) -> Dict
Parameters
| Parameter | Type | Description |
|---|
token_id | string | Required. The outcome token ID to sell |
shares | float | Number of shares to sell |
price | float | Limit price per share (0.01 - 0.99). Required for GTC orders |
usdc_amount | float | USDC value of shares to sell. For market orders only |
order_type | string | GTC (limit), FOK (fill or kill), or FAK (market). Default: GTC |
Returns
| Field | Type | Description |
|---|
success | bool | Whether the order was placed successfully |
orderID | string | The created order ID |
status | string | Order status (see below) |
takingAmount | string | USDC received (for SELL orders) |
makingAmount | string | Tokens sold (for SELL orders) |
transactionsHashes | list | Transaction hashes from Polymarket |
errorMsg | string | Error message if order failed (optional) |
Status Values
GTC (limit) orders:
live: Order placed on the order book
PLACED: Order successfully created
Market orders (FOK/FAK):
matched: Order filled immediately
delayed: Order accepted but processing
unmatched: Order couldn’t be filled (FOK rejected, FAK partially filled)
Example
from polyhush import PolyhushClient
client = PolyhushClient(api_key="your-api-key")
# Limit order
result = client.sell(token_id="123...", shares=100, price=0.65)
# Market order - sell entire position
positions = client.get_positions(detailed=True)
pos = next((p for p in positions if p['token_id'] == token_id), None)
if pos and pos['available_to_sell'] > 0:
client.sell(token_id=token_id, shares=pos['available_to_sell'], order_type="FAK")
Market Order Minimums: FOK/FAK orders have minimum size requirements that vary by market. Very small sell orders may be rejected. If your order fails with “minimum order size” error, increase the amount.
Order Types
| Type | Behavior |
|---|
GTC | Sits on order book until filled or cancelled |
FOK | Must fully fill immediately or cancel entirely |
FAK | Fills what’s available immediately (market order) |
Use get_positions(detailed=True) to check available_to_sell before selling—this accounts for shares reserved in pending sell orders.