Not possible to make market order with base_size

I’m trying to make a market order to buy BTC with EUR. I want to specify the BTC amount, like in the Advanced trade UI, so I make this request:

{
  "product_id": "BTC-EUR",
  "side": "BUY",
  "order_configuration": {
    "market_market_ioc": {
      "base_size": "0.01"
    }
  }
}

However, that gives me an error: Market buys must parameterized in quote currency.

I don’t want to specify the quote currency (EUR). Is this possible, or am I doing anything wrong?

Hi @tomas! Welcome to the Coinbase Cloud Developer’s Forum! For the details regarding your concern, please note that we are still checking on this for you with our team. We will get back to you once we have more information. Keep in touch!

2 Likes

Hello @tomas! Thank you for your patience as we look into this.

As per our checking, the amount of quote currency to spend on order should be specified under the quote_size parameter when using the Create Order endpoint. To specify this, simply follow the steps listed below:

  1. Browse over the body parameters listed under this API Reference and click under the order_configuration object parameter.
  2. From the drop-down menu, click on the market_market_ioc object configuration object.
  3. Select the quote_size parameter and fill in the corresponding value that equates to the amount of quote currency to spend on order.

We hope this helps. Please feel free to reply back to this thread should you have further concerns.

1 Like

The problem is I don’t know the quote size.
In my example, the product ID is BTC-EUR, i.e. BTC is the base currency and EUR is the quote currency. I want to buy 0.01 BTC at current market price. I don’t know what the price is, so I can’t specify it in EUR.
I even tried quote_size: 0.01 but that returned PREVIEW_INVALID_QUOTE_SIZE_TOO_SMALL (obviously, since that would mean 0.01 EUR). I also tried switching the product ID to EUR-BTC, which gives error 502.

Hi @tomas! We’ve got your prompt response and based on your scenario, we can see that you actually passed an invalid quote_size and base_size. Related to this, we recommend you to use this converter to determine the correct quote_size and base_size values that could fit your request. We hope this helps. Thank you!

2 Likes

I can’t convert before every request, the price changes all the time so it would definitely change in between my conversion request and my order request.

All I want to do is buy 0.01 BTC at current market price. I don’t care how much EUR that price is.

With the old API, I did a POST request to create new order which did just that:

{
  "type": "market",
  "side": "buy",
  "product_id": "BTC-EUR",
  "size": 0.01
}

It used to work fine. I want to do exactly the same with the new API.

Please check Create a new order

When placing a market order you can specify funds and/or size. Funds will limit how much of your quote currency account balance is used and size will limit the bitcoin amount transacted.

Coinbase Pro API allows to specify only size, only funds or both for market orders!

I also use size for both - buy and sell orders. I always want to buy/sell specified base amount! Sounds like with Advanced Trade it is not possible and it will be problem for me too!

1 Like

Hi @muktupavels and @tomas! Thanks for pointing this out. We understand that you want to use size (Base Currency) when placing an order. We will check on this for you with our team and update you on our findings. We appreciate your patience!

2 Likes

Hello @muktupavels and @tomas! Upon further reviewing with the team, unfortunately, we currently don’t have the functionality that you are hoping for. We would like to recommend that you post this in the Feedback Section of the Forum as most new features and improvements to Coinbase come directly from feedback like yours, so it’s very valuable to us. While we can’t offer any specific timeline for the addition of new features, we are constantly working to build products our customers will love. Thank you for understanding and keep in touch!

2 Likes

Really hoping they fix this soon, but for now just make a limit order in the base currency, with a limit price of 10x the current price. (or /10 if selling)

limit_limit_gtc: {
  base_size: base_size,
  limit_price:(currentPrice * 10).toString(),
},

If the base currency goes 10x before you get the order in, you got other problems lol