Place an order
Journal an order, run the risk rules, and send it to the venue named by its market id.
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
| Name | Type | Description |
|---|---|---|
market_id | string | Synpath id, venue:native. |
side | string | buy (YES) or sell (NO). |
amount | decimal | Contracts. |
type | stringdefault limit | limit or market for the venue; stop_market, stop_limit, trailing_stop, iceberg, oco, bracket, twap, peg for the engine. |
price | decimal | The YES price, 0 to 1. Required for a limit; the protection price for a market order. |
stop_price | decimal | For stop orders. |
time_in_force | stringdefault gtc | gtc, ioc, fok, gtd (with expires_at) or day. |
expires_at | integer | Milliseconds since epoch. Required with gtd. |
post_only | booleandefault false | Rest or be refused; never take. |
reduce_only | booleandefault false | Only reduce a position. On Polymarket this makes sell sell your YES tokens instead of buying NO. |
client_order_id | string | Your idempotency key. Generated if absent; a retry with the same key is the same order. |
account | object | {venue, name, subaccount} when you hold several accounts on a venue. |
book | string | The strategy or desk this belongs to; positions and P&L roll up by it. |
trader | string | |
tags | object | Free-form string pairs kept on the order. |
notes | string | Free text kept with the order in the journal. |
params | object | Venue-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){
"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": {}
}
