Hi
This is quite common in low liquidity markets. There is usually also a large spread between the best back and lay prices. My theory is that the prices are quite likely to be market-maker bots. Towards the end of a game, it is very difficult to hedge or trade out, so they don’t offer prices anymore. You can see this demonstrated very well on prominent bookmaker sites. Some minutes before the end of a game they start to close down markets.
There are a number of things you can do. Here are a few ideas:
Rather than taking the best available price, you could offer a price in the vicinity of last traded price.
You could set a condition to only place a bet if the market’s matched volume is greater than a specified amount.
And you can set a condition to check the number of ticks between back and lay price is reasonable:
g_ticks(back_price, lay_price) is less than x ticks.