Overview
Prediction market books are thin. That is not a defect, it is what a market for a specific question about a specific event looks like: a few hundred shares at the touch, a few hundred more a couple of cents away, then a gap. Which means a market order for size does not fill at the price you saw. It walks the book, and you pay the average of every level it eats. On top of that, everyone watching sees a large aggressive order and adjusts before your next one. Two tools address this from opposite directions. This guide covers when each is right, how to tune them, and how to combine them when you need both fill certainty and a decent price.TL;DR
- TWAP splits a budget into clips over a time window. Takes liquidity, high fill certainty, costs you the spread.
- Iceberg rests a large order while showing one clip at a time. Provides liquidity, earns the spread, may not fill at all.
- Iceberg slices are post-only. Price a buy above the best bid and it is rejected for crossing the book.
- Both return a
record_idand live onGET /v2/trade/strategies, not open orders. cancel-alldoes not stop them. Cancel strategies individually.- Both keep running if your process dies, which is a feature, not a risk to manage away.
What you will do
- Work out whether your order is actually large relative to a given book
- Run a TWAP with tuning you can justify rather than defaults you copied
- Rest an Iceberg without tripping the post-only rule
- Monitor both on the right endpoint
- Combine them so a deadline is met without paying the spread on the whole position
- Cancel safely, understanding what happens to size already filled
What you will need
Knowledge- Familiarity with order books and the difference between taking and providing liquidity
- Place an order covers the basics if you need them
- A Bravado API key with
trade.executeandtrade.cancel - Enough collateral for the full position
Is your order actually large?
“Large” is relative to the book, not to your account. A useful rule: if your order is more than about a quarter of the size resting within a cent or two of the touch, you will move the price. Consider a book with the best ask at0.62 for 200 shares, 0.64 for 300, then 0.68.
The two approaches
TWAP: spread over a window
Tuning it
duration_sec and interval_sec: how many clips
duration_sec and interval_sec: how many clips
interval_sec has a minimum of 10. Clip count is roughly duration_sec / interval_sec, which sets clip size.Too few clips and each one is large enough to move the market, defeating the purpose. Too many and the strategy outlives the edge you were trading on. A useful sanity check: clip size should sit comfortably inside the size resting at the touch.Also check the floor. A market order needs $1 minimum, so budget_usdc / clip_count must stay above that. $50 over 100 clips is 50 cents a clip and will fail.price_tolerance_pct: your spike protection
price_tolerance_pct: your spike protection
randomize_pct: hiding the pattern
randomize_pct: hiding the pattern
10 is enough to break the pattern without meaningfully changing the average.Iceberg: show a slice, hide the rest
0.60. As that clip fills, another replaces it, until all 5,000 are done or you cancel.
Two constraints on clip_size:
- At least 5 shares, the venue minimum for a resting order.
- Small enough not to signal size, large enough that refills are not constant. Somewhere near the typical resting size at the touch usually works.
Monitor on the right endpoint
Both strategies live here, and not on open orders:record_id here, and whichever slice is currently resting as a child order_id on /v2/trade/orders/open. That is expected, not a duplicate.
PENDING means accepted and waiting for entry conditions, not rejected. Cancelling and re-placing on PENDING churns fees and prevents the strategy from ever working.Cancel safely
filled_size before deciding what to do next. Cancelling a half-executed TWAP leaves you with half a position, which may or may not be what you want.
A correct flatten:
Combining both
When you want most of the position cheaply but cannot risk being unfilled:Rest 70% as an Iceberg at or below the touch
Run a TWAP for the other 30% on your deadline
Poll filled size across both records
filled_size on each.Cancel the Iceberg when the TWAP finishes
Venue constraints
Rejections that trace to these are venue rules, not Bravado validation:- Resting orders need at least 5 shares, which floors
clip_size. - Market orders need $1 notional, which floors TWAP clip size.
- Prices are decimal probabilities from
0.001to0.999. - Iceberg slices must be passive.
Wrapping up
TWAP buys time-weighted certainty and pays the spread for it. Iceberg earns the spread and pays for it in fill risk. Neither is better; they solve different constraints, and combining them lets you choose the ratio. The operational detail that matters most: both run on Bravado’s side, so they survive your process dying. That is what makes them different from a scheduler you write yourself, which stops mid-position the moment it is interrupted.Frequently asked questions
My iceberg slice was rejected for crossing the book.
My iceberg slice was rejected for crossing the book.
My TWAP shows almost nothing filled after an hour.
My TWAP shows almost nothing filled after an hour.
price_tolerance_pct is too tight and the market moved outside it, so clips were skipped. Check filled_size against elapsed time and widen the tolerance if the market is genuinely trending.Why does my iceberg appear twice?
Why does my iceberg appear twice?
/v2/trade/strategies and the currently resting slice is on /v2/trade/orders/open. One order, two representations.I cancelled everything but a strategy kept executing.
I cancelled everything but a strategy kept executing.
cancel-all covers CLOB orders only. Cancel each strategy individually with DELETE /v2/trade/strategies/{id}.Can I change duration or clip size on a running strategy?
Can I change duration or clip size on a running strategy?
What happens if the market resolves mid-execution?
What happens if the market resolves mid-execution?
Resources
- Place an order, all eight order types
- Track order and strategy state, where strategies live
- Build a trading bot, choosing order type by size programmatically
- Quote both sides, the market making alternative
- Trade API reference, full field documentation
- Error reference, rejection messages and causes