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?

2 Likes

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!

3 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.

2 Likes

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.

1 Like

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!

3 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.

1 Like

Please check https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postorders-1

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!

2 Likes

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!

3 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!

3 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

1 Like

I have the same problem. The solution from jmicko is no option.
I want to buy 10 BAT-EUR and not BAT-EUR for 10 EUR.
I also don’t care how much EUR that price is.
The topic is 1 year old and no solution?

I am also waiting for this…

Here I was told that functionality should be available in Q1.

Also I was told that Coinbase Pro API will be available while fixes/upgrades are not available! But I have already received email that my Coinbase Pro balance will be migrated to Advanced Trade on December 1, 2023

AddOn:
My complete software is based on this function.
Also, the response of buy and sell is realy sad. I can’t see how much crypto I have got and no fee.
I hope, PRO is working on until the old features are not implemented to ADVANCED.

@Loop_11 , @rishabh When this will be available?

Hi @tomas @muktupavels! Thank you for sharing this. We have taken this as a feedback! We shall soon reach out to you with an update. Please be in touch.

Hi @Loop_11
Is there any news for this?

Hi @NutCracker0! Apologies for the delay. The team is still working on it. Unfortunately we do not have an ETA for this yet. However as soon as we get any updates, we shall update on this thread!