Coinbase Prime supports a variety of order types to meet different trading strategies and execution requirements. Each order type has specific parameters and behaviors that determine how and when the order is executed. Understanding these order types is crucial for effective trading on the Prime platform.

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.

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
OrdersService ordersService = PrimeServiceFactory.createOrdersService(client);

CreateOrderRequest request = new CreateOrderRequest.Builder()
    .portfolioId("PORTFOLIO_ID_HERE")
    .productId("ETH-USD")
    .side(OrderSide.BUY)
    .type(OrderType.MARKET)
    .baseQuantity("0.003")
    .clientOrderId(UUID.randomUUID().toString())
    .build();

CreateOrderResponse response = ordersService.createOrder(request);

To learn more about this SDK, please visit the Prime Java SDK.

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
OrdersService ordersService = PrimeServiceFactory.createOrdersService(client);

CreateOrderRequest request = new CreateOrderRequest.Builder()
    .portfolioId("PORTFOLIO_ID_HERE")
    .productId("ETH-USD")
    .side(OrderSide.SELL)
    .type(OrderType.LIMIT)
    .baseQuantity("0.003")
    .limitPrice("2000.00")
    .timeInForce(TimeInForceType.GOOD_UNTIL_CANCELLED)
    .clientOrderId(UUID.randomUUID().toString())
    .build();

CreateOrderResponse response = ordersService.createOrder(request);

To learn more about this SDK, please visit the Prime Java SDK.

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 and limit_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.
OrdersService ordersService = PrimeServiceFactory.createOrdersService(client);

CreateOrderRequest request = new CreateOrderRequest.Builder()
    .portfolioId("PORTFOLIO_ID_HERE")
    .productId("ETH-USD")
    .side(OrderSide.SELL)
    .type(OrderType.STOP_LIMIT)
    .baseQuantity("0.003")
    .stopPrice("3000.00")
    .limitPrice("3001.00")
    .clientOrderId(UUID.randomUUID().toString())
    .build();

CreateOrderResponse response = ordersService.createOrder(request);

To learn more about this SDK, please visit the Prime Java SDK.

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, and limit_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 or quote_value
OrdersService ordersService = PrimeServiceFactory.createOrdersService(client);

CreateOrderRequest request = new CreateOrderRequest.Builder()
    .portfolioId("PORTFOLIO_ID_HERE")
    .productId("ETH-USD")
    .side(OrderSide.BUY)
    .type(OrderType.TWAP)
    .baseQuantity("0.5")
    .limitPrice("3100.00")
    .startTime(Instant.now().toString())
    .expiryTime(Instant.now().plus(4, ChronoUnit.HOURS).toString())
    .clientOrderId(UUID.randomUUID().toString())
    .build();

CreateOrderResponse response = ordersService.createOrder(request);

To learn more about this SDK, please visit the Prime Java SDK.

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, and limit_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.
OrdersService ordersService = PrimeServiceFactory.createOrdersService(client);

CreateOrderRequest request = new CreateOrderRequest.Builder()
    .portfolioId("PORTFOLIO_ID_HERE")
    .productId("ETH-USD")
    .side(OrderSide.SELL)
    .type(OrderType.VWAP)
    .baseQuantity("0.5")
    .limitPrice("3100.00")
    .startTime(Instant.now().toString())
    .expiryTime(Instant.now().plus(6, ChronoUnit.HOURS).toString())
    .clientOrderId(UUID.randomUUID().toString())
    .build();

CreateOrderResponse response = ordersService.createOrder(request);

To learn more about this SDK, please visit the Prime Java SDK.

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 or quote_value
OrdersService ordersService = PrimeServiceFactory.createOrdersService(client);

CreateOrderRequest request = new CreateOrderRequest.Builder()
    .portfolioId("PORTFOLIO_ID_HERE")
    .productId("SOL-USD")
    .side(OrderSide.BUY)
    .type(OrderType.RFQ)
    .baseQuantity("0.1")
    .clientOrderId(UUID.randomUUID().toString())
    .build();

CreateOrderResponse response = ordersService.createOrder(request);

To learn more about this SDK, please visit the Prime Java SDK.

Order Parameters Summary

ParameterRequired ForDescription
product_idAllThe trading pair (e.g., “BTC-USD”)
sideAllBUY or SELL
typeAllOrder type (MARKET, LIMIT, etc.)
client_order_idAllUnique client-generated identifier
stp_idAllSelf-Trade prevention (Stp) Id
base_quantityMostOrder size in base asset units
quote_valueMostOrder size in quote asset units
limit_priceLIMIT, TWAP, VWAP, STOP_LIMITMaximum/minimum execution price
stop_priceSTOP_LIMITPrice that triggers the order
start_timeTWAP, VWAPWhen the order should start executing
expiry_timeTWAP, VWAP, GTD ordersWhen the order expires
time_in_forceLIMIT, STOP_LIMITHow long the order remains active
post_onlyLIMITEnsures order adds liquidity
display_quote_sizeLIMITThis 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_sizeLIMITThis 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.

Please note: All requests discussed above require proper authentication. For more information, visit REST API Authentication.