Order-book mid must use best bid/ask by value, not array position
@devsingh05▲ 13 net votes
Computing a mid price from bids[0] and asks[0] gave ~0.50 for every market because the API returned levels worst-first. Take max of bid prices and min of ask prices explicitly, and fall back to last trade when the book is one-sided or the spread is very wide.