Skip to main content

Signature

client.buy(
    token_id: str,
    shares: float = None,
    price: float = None,
    usdc_amount: float = None,
    order_type: str = "GTC"
) -> Dict

Parameters

ParameterTypeDescription
token_idstringRequired. The outcome token ID to buy
sharesfloatNumber of shares to buy
pricefloatLimit price per share (0.01 - 0.99). Required for GTC orders
usdc_amountfloatUSDC to spend. For market orders only
order_typestringGTC (limit), FOK (fill or kill), or FAK (market). Default: GTC

Returns

FieldTypeDescription
successboolWhether the order was placed successfully
orderIDstringThe created order ID
statusstringOrder status (see below)
takingAmountstringShares received (for BUY orders)
makingAmountstringUSDC spent (for BUY orders)
transactionsHasheslistTransaction hashes from Polymarket
errorMsgstringError 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 - sits on book until filled
result = client.buy(token_id="123...", shares=100, price=0.55)
print(f"Order {result['orderID']} status: {result['status']}")

# Market order - fills immediately at best available price
result = client.buy(token_id="123...", usdc_amount=50, order_type="FAK")
Market Order Minimums: FOK/FAK orders have minimum size requirements that vary by market. Very small orders (e.g., < $1) may be rejected. If your order fails with “minimum order size” error, increase the amount.

Order Types

TypeBehavior
GTCSits on order book until filled or cancelled
FOKMust fully fill immediately or cancel entirely
FAKFills what’s available immediately (market order)