Got "The counterparty's best price does not meet the PERCENT_PRICE filter limit"

Hi, I’ve got The counterparty's best price does not meet the PERCENT_PRICE filter limit on MARKET order in Production.
Looking at docs, there is PERCENT_PRICE descripted here.

I have 3 questions:

  1. Is this the PERCENT_PRICE which error mentioned? (I mean I place market order, never heard this filter affects market order)
  2. If 1 is true, which price should I use for this fomular?
  3. How is multiplierDecimal being used?
  1. Is this the PERCENT_PRICE which error mentioned? (I mean I place market order, never heard this filter affects market order)

Yes, this is the same filter mentioned in the error.

  1. If 1 is true, which price should I use for this fomular?

It’s slightly more complicated when dealing with MARKET orders. The price used depends on the lowest/highest price the MARKET order trades at. A large BUY MARKET order may encounter slippage which surpasses the markPrice * multiplierUp due to low liquidity in the order book, causing the PERCENT_PRICE filter error.

  1. How is multiplierDecimal being used?

multiplierDecimal refers to the precision of multiplierUp and multiplierDown. It is not used when performing the FILTER check.

1 Like

Thanks for your detailed answer. I just want to clearify some more:

  1. So in that fomular, I will get the worst price that market order will be matched to, not the median price?
    For example, user place long 1 BTC, there are 2 sell limit orders: 0.2 at 40k, 0.8 at 41k. So price should be what:
    a) price = worst price = 41k,
    b) price = (0.2*40) + (0.8*41) = 40.8k

  2. This filter will be applied on both when user open position, and when user close position (reduce only order) right? (I want to clearify that if user close position, is there any chance they meet this error).

  1. So in that fomular, I will get the worst price that market order will be matched to, not the median price?
    For example, user place long 1 BTC, there are 2 sell limit orders: 0.2 at 40k, 0.8 at 41k. So price should be what:
    a) price = worst price = 41k,
    b) price = (0.2*40) + (0.8*41) = 40.8k

Price used in the limit check would be 41k

  1. This filter will be applied on both when user open position, and when user close position (reduce only order) right? (I want to clearify that if user close position, is there any chance they meet this error).

Filter is applied to any order request, even if the order would reduce a position.

1 Like