Understand priceIncrement and sizeIncrement in level2 channel

Hello,

I tried to figure out the priceIncrement and sizeIncrement.

    {
        "auction_mode": false,
        "base_currency": "ETH",
        "base_increment": "0.00000001",
        "base_max_size": "12000",
        "base_min_size": "0.00022",
        "cancel_only": false,
        "display_name": "ETH/USD",
        "fx_stablecoin": false,
        "id": "ETH-USD",
        "limit_only": false,
        "margin_enabled": false,
        "max_market_funds": "20000000",
        "max_slippage_percentage": "0.02000000",
        "min_market_funds": "1",
        "post_only": false,
        "quote_currency": "USD",
        "quote_increment": "0.01",
        "status": "online",
        "status_message": "",
        "trading_disabled": false
    }

For example,

{
  "type": "l2update",
  "product_id": "ETH-USD",
  "changes": [
    [
      "buy",
      "3069.04",
      "1.01659085"
    ]
  ],
  "time": "2022-04-20T15:47:22.915551Z"
}

The l2update means that someone likes to buy a total of 1.01659085 ETH and each ETH costs $3069.04 USD.

However, based on the doc, I see the following:

The base_min_size and base_max_size fields define the min and max order size.

Here, the "base_min_size": "0.00022" which has less precision than 1.01659085.

My observation is that:

base_increment ==> the sizeIncrement for ETH

Question> I know my understanding is incorrect. May you please tell me the correct way to infer the sizeIncrement for “ETH-USD”?

Thank you

Hello @q0987, you were actually on the right path. You were right in interpreting the API response. Specifically, for your example, base currency = ETH, quote currency = USD. We are sorry if it was a little bit confusing. You stated that it was “not accurate.” However, upon investigation, you compare the base_min_size = 0.00022 (5 decimal places) to the extracted amount of 1.01659085 ETH (8 decimal places). In essence, the quoted amount of ETH can still apply since the base_increment= 0.00000001 also holds 8 decimal places.

This is to say that the base_min_size and base_max_size fields define the min and max order size for POSTing (placing) orders onto Coinbase Pro/Exchange. So long as the size you specify is within the range, and is precise up to 8 decimal places, the post order can push through.

The size value that is returned in L2 Channel is the actual FILL related to the order itself. Note that each Order can have multiple FILLS, which can be less than the actual order.

The Fills increment is defined by base_increment. The size property is the updated size at that price level, not a delta. A size of "0" indicates the price level can be removed.

3 Likes

Hello,

The part that confused me is the following:

The quote_increment field specifies the min order price as well as the price increment.

The base_increment field specifies the minimum increment for the base_currency.

Based on the above doc, the base_increment is for price. But it seems to me(and based on your response) that it applies to both price and size.

Also I didn’t follow what you said below:

The size value that is returned in L2 Channel is the actual FILL related to the order itself. Note that each Order can have multiple FILLS, which can be less than the actual order.

This is a L2 message:

{
  "type": "l2update",
  "product_id": "ETH-USD",
  "changes": [
    [
      "buy",
      "3069.04",
      "1.01659085"
    ]
  ],
  "time": "2022-04-20T15:47:22.915551Z"
}

The size(i.e. 1.01659085) is the size avaible for the price of $3069.04. I don’t know why you related this to FILLS?

Thank you

Hello @q0987 ! We apologize for the confusion. We should not have mentioned FILLS.

For clarifications in the example of ETH-USD Level2 update:

{
  "type": "l2update",
  "product_id": "ETH-USD",
  "changes": [
    [
      "buy",
      "3069.04",
      "1.01659085"
    ]
  ],
  "time": "2022-04-20T15:47:22.915551Z"
}

There was BUY order for ETH-USD place for 1.01659085 ETH @ 3069.04 USD.

ETH is the Base currency
USD is the Quote currency

The base decimal precision i.e. base_increment, for ETH is 8 decimals, i.e 0.00000001 , so 8 decimals = 1.01659085
The quote decimal precision i.e. quote_increment, for USD is 2 decimals, ie 0.01, so two (2) decimals = 3069.04

The other issue around base_min_size (and base_max_size ) is for the minimum or maximum amount you can place an order on the book. So for ETH-USD following values are valid minimum for ETH:
ETH order amount must be >= .00022 and <= 12000

Therefore sample values/responses:

.00022 = good → at minimum
.00022001 = good —> above Min AND <= 8 decimals
.00021999 = rejected → below minimum of .00022
.000220001 = Rejected → > 8 decimals

4 Likes