Error: 'INVALID_SIZE_PRECISION',Too many decimals in order amount

Hello guys, Please where can I get the exact precision to use in opening a take profit order or stop loss order.

I used this endpoint (brokerage/products) to get the product details, then filtered it by the product_id, then used the base_min_size for the base_size and quote_min_size for the limit_price but still having the same error for SOL-USD

Please how do I navigate this?

You need to look at / use base_increment and quote_increment/price_increment when you format sizes.

Thanks for your kind response, but it still didn’t work. In this case I am trying to open a SOL-USD Order.

This is the order response.

{
  success: false,
  failure_reason: 'UNKNOWN_FAILURE_REASON',
  order_id: '',
  error_response: {
    error: 'INVALID_SIZE_PRECISION',
    message: 'Too many decimals in order amount',
    error_details: '',
    preview_failure_reason: 'PREVIEW_INVALID_SIZE_PRECISION'
  },
  order_configuration: {
    limit_limit_gtc: {
      base_size: '0.17491370',
      limit_price: '118.87',
      post_only: false
    }
  }
}

Please what am I doing wrongly?

This is the product Details for this pair.

{
  product_id: 'SOL-USD',
  price: '51754.7',
  price_percentage_change_24h: '0.03160131701146',
  volume_24h: '18517.26400139',
  volume_percentage_change_24h: '-8.53001199855768',
  base_increment: '0.00000001',
  quote_increment: '0.01',
  quote_min_size: '1',
  quote_max_size: '150000000',
  base_min_size: '0.000016',
  base_max_size: '3400',
  base_name: 'Bitcoin',
  quote_name: 'USDC',
  watched: false,
  is_disabled: false,
  new: false,
  status: 'online',
  cancel_only: false,
  limit_only: false,
  post_only: false,
  trading_disabled: false,
  auction_mode: false,
  product_type: 'SPOT',
  quote_currency_id: 'USDC',
  base_currency_id: 'BTC',
  fcm_trading_session_details: null,
  mid_market_price: '',
  alias: 'BTC-USD',
  alias_to: [],
  base_display_symbol: 'BTC',
  quote_display_symbol: 'USD',
  view_only: false,
  price_increment: '0.01',
  display_name: 'BTC-USDC'
}

Where are you getting product details/info? SOL-USD and SOL-EUR for me has 0.001 precision! So you can specify only 0.174

https://api.coinbase.com/api/v3/brokerage/products

I am using this link. please which are you using?

Same, but SOL-USD for me has following data:

{"product_id":"SOL-USD", "price":"112.62", "price_percentage_change_24h":"-4.04703075743376", "volume_24h":"1050133.507", "volume_percentage_change_24h":"-4.04358172032179", "base_increment":"0.001", "quote_increment":"0.01", "quote_min_size":"1", "quote_max_size":"25000000", "base_min_size":"0.08", "base_max_size":"1274000", "base_name":"Solana", "quote_name":"US Dollar", "watched":false, "is_disabled":false, "new":false, "status":"online", "cancel_only":false, "limit_only":false, "post_only":false, "trading_disabled":false, "auction_mode":false, "product_type":"SPOT", "quote_currency_id":"USD", "base_currency_id":"SOL", "fcm_trading_session_details":null, "mid_market_price":"", "alias":"", "alias_to":["SOL-USDC"], "base_display_symbol":"SOL", "quote_display_symbol":"USD", "view_only":false, "price_increment":"0.01", "display_name":"SOL-USD"}

Also look at price, your data shows that SOL-USD price is 51754.7… I guess you are actually trying to use BTC-USD data… Oh, it even mentions Bitcoin… Looks like you have some problems fetching products!

Oh wow, what do you think is causing the inconsistency?

Check your code for mistakes?

Thank you so much, I found the bug.
Please one last question. Can I have two Open Order one to take profit and ones or Stop loss on Coinbase?