Synpath
Orders

Place an order

Journal an order, run the risk rules, and send it to the venue named by its market id.

POST/ordersself-hosted · access token · trade

Self-hosted. Served by synpath serve on your own machine or host, which must be running; the engine and its order types live there. Nothing on this page runs on Synpath's servers.

side is on the YES leg: buy takes YES, sell takes NO, and price is always the YES price. Selling at 0.70 is the same order as buying NO at 0.30.

Nothing is sent that was not written down first. The intent is journaled with its client_order_id, then the venue is called, then the answer recorded; a process killed in between recovers the order on restart instead of duplicating it. A risk refusal answers 409 with the rule that refused, by name. A refusal by the venue, such as insufficient balance, answers 400 with the venue's reason.

The order is routed by the venue in market_id. A market order still takes a price: on venues without native market orders it is sent as an immediate-or-cancel limit at that protection price.

Request body

NameTypeDescription
market_idstringSynpath id, venue:native.
sidestringbuy (YES) or sell (NO).
amountdecimalContracts.
typestring
default limit
limit or market for the venue; stop_market, stop_limit, trailing_stop, iceberg, oco, bracket, twap, peg for the engine.
pricedecimalThe YES price, 0 to 1. Required for a limit; the protection price for a market order.
stop_pricedecimalFor stop orders.
time_in_forcestring
default gtc
gtc, ioc, fok, gtd (with expires_at) or day.
expires_atintegerMilliseconds since epoch. Required with gtd.
post_onlyboolean
default false
Rest or be refused; never take.
reduce_onlyboolean
default false
Only reduce a position. On Polymarket this makes sell sell your YES tokens instead of buying NO.
client_order_idstringYour idempotency key. Generated if absent; a retry with the same key is the same order.
accountobject{venue, name, subaccount} when you hold several accounts on a venue.
bookstringThe strategy or desk this belongs to; positions and P&L roll up by it.
traderstring
tagsobjectFree-form string pairs kept on the order.
notesstringFree text kept with the order in the journal.
paramsobjectVenue-specific extras passed through untouched, and the engine's own (trail, trigger_source, legs).

Response

The order as the venue reported it. Status 201.

import synpath
from synpath import OrderRequest

client = synpath.Client(synpath.load_credentials())
order = await client.create_order(OrderRequest(
    market_id="polymarket:2252244",
    side="buy",              # buy takes YES, sell takes NO
    type="limit",
    price="0.10",            # the YES price
    amount=5,
    client_order_id="quickstart-1",
))
print(order.id, order.status)
200
{
  "id": "01a0afc0-46e8-7596-b183-1ff448331615",
  "client_order_id": "quickstart-1",
  "venue": "kalshi",
  "account": {
    "venue": "kalshi",
    "name": "desk-a",
    "subaccount": null
  },
  "market_id": "kalshi:KXELONMARS-99",
  "side": "buy",
  "type": "limit",
  "time_in_force": "gtc",
  "status": "open",
  "held_by": "venue",
  "price": "0.10",
  "stop_price": null,
  "amount": "5",
  "filled": "0",
  "remaining": "5",
  "average_price": null,
  "cost": null,
  "fee": null,
  "fee_currency": "USD",
  "last_fill_price": null,
  "last_fill_amount": null,
  "post_only": false,
  "reduce_only": false,
  "expires_at": null,
  "created_at": 1789655008000,
  "updated_at": 1789655008000,
  "parent_id": null,
  "queue_priority_preserved": null,
  "book": "alpha",
  "trader": "tester",
  "tags": {},
  "info": {}
}