Why do I get an error about quote size precision while calling the CreateOrder endpoint?

When I call:
POST https://coinbase.com/api/v3/brokerage/orders

With the following body:
“{"client_order_id":"d312bef4-fc4e-4e73-bb85-53955578f5fd","product_id":"ADA-USDC","side":"BUY","order_configuration":{"market_market_ioc":{"quote_size":"131.4980"}}}”

I get the following failed result:
{“success”:false,“failure_reason”:“UNKNOWN_FAILURE_REASON”,“order_id”:“”,“success_response”:null,“error_response”:{“error”:“UNKNOWN_FAILURE_REASON”,“message”:“”,“error_details”:“”,“preview_failure_reason”:“PREVIEW_INVALID_QUOTE_SIZE_PRECISION”,“new_order_failure_reason”:null},“order_configuration”:{“market_market_ioc”:{“quote_size”:131.498,“base_size”:null},“limit_limit_gtc”:null,“limit_limit_gtd”:null,“stop_limit_stop_limit_gtc”:null,“stop_limit_stop_limit_gtd”:null}}

Why do I get this error (PREVIEW_INVALID_QUOTE_SIZE_PRECISION)? It seems that something is wrong with the quote precision, but ADA-USDC uses a quote_increment of 0.0001 as I specified (131.4980).

Hope someone knows what is happening here.

Regards,
NiLo

The body you posted - is that actually what you are generating and trying to POST?

order_configuration looks weird in your response… I think API returns configuration as it was sent, at least it looks like that from my testing. Yours include other order types with null values and more importantly quote_size is double not string.

EDIT: Just did extra test and configuration in response did not include other order type that I added. So I guess this is bug / regression.

Yes, this is from the same code that performs multiple orders successfully on a daily basis.

Hi @NiLo! Welcome to the forum community!
Thank you for reaching out to us regarding this issue.
The error about quote size precision while calling the CreateOrder endpoint in the Advanced Trade API typically occurs when the quote size specified in the order doesn’t match the required minimum increment for the quote currency. For example, if you’re trading BTC-USD pair, the minimum increment for the quote currency (USD) must be 0.01. If you specify a quote size that does not conform to this precision, the API will reject the order and return an error.

Apart from that there are some common error messages and issues related to the Advanced Trade API that you can refer to for possible solutions:

  1. Insufficient Funds: This error occurs when you try to place an order with an amount greater than your current balance for that asset. You can either lower your order amount or add funds to your balance to place the order.
    .
  2. Minimum and maximum orders: If you try to place an order that exceeds the maximum decimal amount, you will receive an error message. You can either reduce the number of decimal points or adjust your order size to comply with the minimum and maximum order size requirements**.**
    .
  3. Error messages related to order placement: If you encounter any issues while placing an order, you can refer to the list of error messages provided by Coinbase Help**.**
    .
  4. WebSocket API rate limits: The WebSocket API has a rate limit of 750 requests per second. If you exceed this limit, you may encounter an error.
1 Like

Hi,

Thanks for your reply.

I’m aware of the required minimum increment. Prior to the CreateOrder call I retrieve the productdetails from your API and use the property quote_increment to specify the proper quote_size. For ADA-USDC it is for example 0.0001. This worked for weeks without problems and since two days I sometimes (not always, most orders this way, are being executed successfully) get the error “PREVIEW_INVALID_QUOTE_SIZE_PRECISION” back from your API.

Can you please explain this error message to me so I can take measures to prevent this from happening again in the future?

1 Like

Hey @NiLo The “PREVIEW_INVALID_QUOTE_SIZE_PRECISION” error message indicates that the specified quote size for an order is invalid or too large.

The quote size represents the amount of the quote currency (e.g., USD) that you want to trade. It is possible that the quote size you are trying to use exceeds the maximum allowed quote size for the given product (e.g., ADA-USDC).To resolve this issue, you should:

  1. Check the maximum allowed quote size for the specific product (e.g., ADA-USDC) using the Coinbase Advanced Trade API.
  2. Ensure that the quote size you are specifying for an order does not exceed the maximum allowed quote size.
  3. If you are still encountering the error, consider reducing the quote size or splitting the order into multiple smaller orders to stay within the allowed quote size limit.

To prevent this error, it is important to ensure that the quote size is formatted according to the precision requirements for the specific product.

We hope this answers your question. Do let us know if you have any more doubts or questions.