curl. Nothing to install.
Every response below is real output from running these exact commands.
1. Create a key
Sign in to SOAR and create an API key with theread and trade scopes. You need
both — scopes do not nest, and a trade-only
key cannot read back the order it just placed.
The key is shown once. Save it:
Full details, including the 10-key limit and how to revoke:
Authentication.
2. Find something to trade
strike_value and the fee rates are decimal strings, not numbers — at these
magnitudes a float would lose precision. And cursor is the empty string because this
is the last page; it is never absent.
3. Orient in one call
snapshot returns the market, the book, the last trade, the stats, and your position
and resting orders in it — everything a decision needs, in one round trip.
positions and resting_orders are empty arrays because
this account holds nothing here yet — empty collections are always [], never null.
trade_id is opaque: use it to deduplicate, never to sort. Order by created_at.
4. Place an order
Agtc buy at 3¢ — far below the bid, so it rests instead of trading. Exactly what
you want the first time.
order_idis a string of digits. It exceeds what a JavaScript number represents exactly. Parse it as a number and you will eventually cancel an order that does not exist.client_order_idis yours, unique among your own orders. Re-sending the same one returns the existing order rather than creating a second — which is what makes a retry safe when a write returns503 result_unknown. Read that before going live →
You can watch that dedup work right here: run this command twice unchanged and the
second response is the same
order_id as the first, in whatever state that order
has reached. Use a fresh client_order_id when you actually want a second order.5. Cancel it, and check your balance
While the order rests, its collateral is held. Check first:order_id from your own step 4 response — the one below
is from this transcript and is long since canceled:
reduced_by is the quantity the cancel actually pulled off the book — 1, the whole
order. Had part of it filled while your request was in flight, this would be smaller,
and that number is the truth rather than what you assumed you were canceling.
reserved_cents is back to zero and available_cents is whole again: the collateral is
released the moment the cancel is acknowledged. All amounts are integer cents —
5000000 is $50,000.
What next
Survival ladders
Why five rung prices describe a whole valuation distribution.
Binary markets
Why
buy no and sell yes are the same order, and why there are no shorts.Errors
The code vocabulary, what to retry, and
result_unknown.API reference
Every endpoint, with a playground that sends real requests.