Market Orders
Market orders are executed immediately at the best available price in the market. They provide the fastest execution but may result in price slippage, especially for large orders or in volatile markets. Market orders can partially execute and cancel when market conditions prevent full execution. Key Characteristics:- Immediate execution or cancellation at current market prices
- No price guarantee - execution price depends on market liquidity
- Best for quick entry/exit when price is less critical than speed
- Can partially execute and cancel if full execution is not possible
- Market orders are submitted as limit IOC orders with a 5% slippage collar
- Any unfilled size is retried against the latest order book with a fresh collar
- Orders are capped at 5 seconds total, after which they are either filled, partially filled, or canceled
- If you hold 100 XRP valued at 3 USD each (total value: 300 USD), you can only place a quote sell order for up to 285 USD (95% of 300 USD)
- This protection prevents scenarios where price slippage or market volatility during execution would require selling more XRP than available
Time in Force Options
All order types support various time-in-force options that determine how long the order remains active:- GOOD_UNTIL_CANCELLED (GTC): Order stays on the books until cancelled
- GOOD_UNTIL_DATE_TIME (GTD): Order expires at a specific date/time (requires
expiry_time
) - IMMEDIATE_OR_CANCEL (IOC): Order begins executing immediately at submission or is cancelled
- FILL_OR_KILL (FOK): Order is fully executed (filled) immediately at submission or is cancelled
Limit Orders
Limit orders allow you to specify the maximum price you’re willing to pay (for buy orders) or the minimum price you’re willing to accept (for sell orders). These orders are only executed if the market price is at or better than the specified limit price. Key Characteristics:- Price protection - orders only execute at or better than the specified price
- Will not execute immediately if market price isn’t better than the limit price
- Requires
limit_price
parameter - Supports various time-in-force options (GTC, GTD, IOC, FOK)
- Can be combined with
post_only
flag to ensure the order adds liquidity
Stop-Limit Orders
Stop-limit orders combine the features of stop orders and limit orders. They are triggered when the market price reaches a specified stop price, at which point they become limit orders with a specified limit price. Key Characteristics:- Requires both
stop_price
andlimit_price
parameters - No limit on max stop price as long as it’s +50bps best ask for buys or -50bps best bid for sells
- Limit price must be above stop price for buys; below stop price for sells
- Limit price must be within 100bps of the stop price
- Order becomes a limit order when stop price is reached
- Provides price protection through the limit price
- Useful for risk management and automated trading strategies.
TWAP Orders (Time-Weighted Average Price)
TWAP orders are designed to execute large orders over time to minimize market impact. The order is broken down into smaller pieces and executed at regular intervals throughout a specified time period. Key Characteristics:- Requires
start_time
,expiry_time
, andlimit_price
parameters - The minimum size of a TWAP order is at least $100 notional per time bucket.
- Executes over a specified time period to minimize market impact
- Useful for large orders that could move the market
- Requires either
base_quantity
orquote_value
VWAP Orders (Volume-Weighted Average Price)
VWAP orders execute based on market volume patterns, aiming to achieve execution prices that track the volume-weighted average price of the market. These orders are particularly useful for institutional trading where minimizing market impact is critical. Key Characteristics:- Requires
start_time
,expiry_time
, andlimit_price
parameters - The minimum size of a VWAP order is at least $100 notional per time bucket.
- Executes based on market volume patterns
- Useful for institutional and large-scale trading.
RFQ Orders (Request for Quote)
RFQ orders allow you to request quotes from liquidity providers before executing a trade. This order type is useful for getting competitive pricing on large trades or less liquid assets. Key Characteristics:- Requests quotes from multiple liquidity providers
- The RFQ quote price is valid for ~2.5 seconds
- Allows comparison of pricing before execution
- May result in better pricing through competition vs CLOB
- Requires either
base_quantity
orquote_value
Order Parameters Summary
Parameter | Required For | Description |
---|---|---|
product_id | All | The trading pair (e.g., “BTC-USD”) |
side | All | BUY or SELL |
type | All | Order type (MARKET, LIMIT, etc.) |
client_order_id | All | Unique client-generated identifier |
stp_id | All | Self-Trade prevention (Stp) Id |
base_quantity | Most | Order size in base asset units |
quote_value | Most | Order size in quote asset units |
limit_price | LIMIT, TWAP, VWAP, STOP_LIMIT | Maximum/minimum execution price |
stop_price | STOP_LIMIT | Price that triggers the order |
start_time | TWAP, VWAP | When the order should start executing |
expiry_time | TWAP, VWAP, GTD orders | When the order expires |
time_in_force | LIMIT, STOP_LIMIT | How long the order remains active |
post_only | LIMIT | Ensures order adds liquidity |
display_quote_size | LIMIT | This is the maximum order size that will show up on venue order books. Specifying a value here effectively makes a LIMIT order into an “iceberg” style order. |
display_base_size | LIMIT | This is the maximum order size that will show up on venue order books. Specifying a value here effectively makes a LIMIT order into an “iceberg” style order. |