Matching engine failing to match FIFO?

Hello everyone,

The matching engine does not match correctly the orders in the order book.

Here is one of many screenshots:

The matching engine is filling my new order and letting the older one unfilled.

This is impacting so much my trading bot and the volume generated for the competition: many times orders get stuck for more than an hour instead of filling it within a minute.

Hope the team will implement the fix quickly.

6 Likes

Is there a possibility this is a misprojection in the interface ? Did your ‘stuck’ order eventually get filled for the limit price you defined ?

2 Likes

No, it’s not a misprojection in the interface.
For this order I canceled it manually. For some others, it got filled after a price movement (all orders at that price got filled).

4 Likes

Thanks for the screenshot Zino, but that doesn’t provide the full picture. Why are you saying is not a visualization issue? It looks like one - one can place a order better priced in the USDC/BTC market that would round to the same price quite easily. The times together with your account email will allow us to inspect the event log to see what made FIFO be apparently violated on this case. It could either be an matching illegality (very unlikely given the tests) or a cache and visualization issue.

  • On the API are you using the inverse market USDC/BTC instead of BTC/USDC?
  • Is the order precision on the API higher than the screenshot you took?
  • Did you cancel the orders before this screenshot?
  • Is the matching aggressor order your own order?
2 Likes

Hey Fabio,

This is an example of how I place an order (marketToBuy = ‘btc_usdc’)
let buysize = (usdcSize / bidstip).toFixed(mktsettings.sizedecimals);
try {
const placedorder = await player.placeLimitOrder(false, api_client_typescript_1.createCurrencyAmount(buysize, mkt.aUnit), api_client_typescript_1.OrderBuyOrSell.BUY, api_client_typescript_1.OrderCancellationPolicy.GOOD_TIL_CANCELLED, api_client_typescript_1.createCurrencyPrice(bidstip.toFixed(mktsettings.pricedecimals), mkt.bUnit, mkt.aUnit), marketToBuy)
.then((placedorder) => {
if (placedorder.status !== api_client_typescript_1.OrderStatus.CANCELLED) {
console.log('Placing buy order ’ + buysize + ’ ’ + marketToBuy + ’ at ’ + buyprice);
}
});
}
catch (e) {
console.log(‘error’);
}

I cancelled the order after the screenshot.

I face the same issue at most of the orders I place.
Now for example:

I don’t think it’s a visualization issue because i’m using the same price precision and I see my bot making new sell orders based on the executed buyorders (see the buy and sell oders in the screenshot with 33 and 16.5 USDC)

I don’t think the matching aggressor order my own order. My bot is MM. He doesn’t place two orders (buy and sell) at the sameprice and I didn’t see an order getting filled from the another one.

Another related issue, sometimes my older order gets filled partially and my new order gets filled totally.

DM me in telegram for more details if you need (pseudo: chrab12)

1 Like

Here is an example with some logs:

3 Likes