Market orders fill instantly but at whatever price the market gives you. Limit orders fill at the price you specify โ or not at all. For AI agents running systematic strategies, limit orders are the difference between a controlled entry and an imprecise one. Purple Flea's order API gives agents complete programmatic control over placement, modification, and cancellation.
Understanding the tradeoffs that determine which order type your agent should use.
A market order says "buy or sell immediately at the best available price." It guarantees execution but not price. In liquid markets during normal conditions, the difference is small. But in volatile markets โ exactly the conditions where your agent is most likely to be trading a signal โ the difference can be significant. This price difference between the expected fill and the actual fill is called slippage.
A limit order says "buy at this price or lower, sell at this price or higher." It guarantees price but not execution. If the market never reaches your limit price, the order simply waits โ or expires, depending on the time-in-force setting. For strategies that rely on specific entry levels (support/resistance, VWAP, opening range), limit orders are essential.
Maker vs. taker economics matter at scale. Market orders consume liquidity โ they fill against existing resting orders in the book and pay the taker fee. Limit orders that rest in the book add liquidity and pay the maker fee, which is lower (or sometimes even negative โ a rebate). An agent placing 200 trades per day at $1,000 average notional will save hundreds of dollars monthly by using limit orders instead of market orders for non-urgent entries.
Post-only orders enforce maker status. With post_only=True, if your limit order would immediately match and execute as a taker, it is cancelled instead of filled. This guarantees you always pay the maker fee โ critical for fee-sensitive systematic agents.
Four order types covering every programmatic trading use case.
The foundational order type. Specify a market, side, size, and price. The order rests in the book until it fills at your specified price or better, or until you cancel it or the time-in-force expires.
order_type: "limit"
price: 42500.00
A two-stage order: define a trigger price and a limit price. When the market reaches the trigger, a limit order is placed at your specified limit price. Combines the conditional activation of a stop with the price control of a limit โ essential for breakout strategies.
order_type: "stop_limit"
stop_price: 43000.00
limit_price: 43100.00
A limit order with a guarantee: if placing the order would cause an immediate match (making it a taker), the order is rejected or cancelled automatically. Your agent will only ever pay the maker fee โ 0.02% โ never the taker fee. Fee-optimal for high-frequency systematic agents.
order_type: "limit"
post_only: True
Control how long a limit order remains active. GTC (Good Till Canceled) rests indefinitely. IOC (Immediate-or-Cancel) fills whatever is available immediately and cancels the rest. FOK (Fill-or-Kill) requires complete fill or full cancellation โ no partial fills.
time_in_force: "GTC" | "IOC" | "FOK"
Place a post-only GTC limit order, then modify the price โ all programmatically.
Every limit order moves through a predictable set of states your agent can monitor.
Your agent can query order status at any time via client.get_order(order_id) or receive push updates by registering a webhook. Status transitions are atomic โ you will never observe an order in an ambiguous intermediate state.
Three structural advantages that compound over hundreds of trades.
An agent operating at scale with precise price targets โ VWAP anchors, Fibonacci levels, fair value gaps โ cannot afford random execution prices. Limit orders ensure the strategy fills exactly where the signal says to fill, or not at all. This preserves the edge that the strategy was built on.
Purple Flea charges 0.02% maker fee and 0.05% taker fee. On a $10,000 notional position, that is $2 vs $5 per trade โ a $3 difference. Over 500 monthly trades, that is $1,500 in saved fees simply by using post-only limit orders instead of market orders. Fee minimization is a real alpha source at agent scale.
In a $500M BTC order book, even moderate-sized market orders move the price. A 2 BTC market buy in thin conditions might fill at an average price 0.3% above the mid. A limit order at the same mid simply waits. For agents trading larger sizes, slippage elimination often exceeds total fee savings in dollar terms.
Infrastructure benchmarks that matter for systematic agents.
The full toolkit your agent needs to manage a live order book.
client.place_orders_batch(). Reduces round-trip latency for agents that need to set up an entire order ladder in a single operation. All orders are submitted atomically.Limit orders are the foundation of every serious agent trading strategy. Get your API key and place your first limit order in under five minutes.