# Cobweb model and efficient market maker order book model

Two years ago I have covered a classical price discovery model known as the cobweb model. While the premise of the model is rather simple, its internal logic seemed flawed to me. Yet at that time I didn't know how to properly explore its flaws.

A bit later on I started exploring order book models and one of the simplest ones, the efficient market marker model, caught my eye and reminded me that I want to explore some issues regarding the cobweb model.

This post (and accompanying app) sat in my "unpublished" folder for a long time, until I have rediscovered it lately and worked out few things which bugged me in this approach. So here, in this post, I will present you with an interactive app, which combines both of these models. I will also provide some discussion on why the combination of these models doesn't work as expected.

## Combined model

Note that this is not a true agent-based model as buyers and suppliers are not heterogeneous and are effectively represented by a single agent. Efficient market maker is the third agent we will meet in this model.

So, from the cobweb model we have the supply and the demand laws. As in the original post these laws can be manipulate by adjusting the respective slopes, $$\alpha_s$$ and $$\alpha_d$$. To add more flexibility to the model we have decided to allow users to change the location of the equilibrium point, $$( Q_{eq}, P_{eq} )$$. The dynamics of the combined model depend on this point only quantitatively, but not only qualitatively.

While from the efficient market marker model we borrow the probability that the market maker will submit the limit order of the same type as the recent market order was, $$p$$. In other words, this probability describes the likelihood that the price will move after executing market order.

The connection between the models is made by assuming that market order submission rates (ones from the efficient market marker model), $$\lambda^{+}$$ and $$\lambda^{-}$$, depend on the existing supply and demand respectively, which are calculated by the means of respective laws given by the cobweb model. These rates are updated each $$\delta$$ time units.

## Dynamics of the model

Sadly, the combined model is always stable. At least in a sense that the price will never diverge. This is because efficient market maker will always provide some "backup" supply or demand, if endogenous (one generated by the agents) supply or demand fails.

Though note that the model discovers the equilibrium point, but only if $$p$$ is not too big. The convergence is well predicted by the supply and demand laws (the points initially follow the lines quite nicely), but the discovery occurs in a very different fashion than it is predicted by the original cobweb model. Furthermore fluctuations around the equilibrium point do not follow the laws well (the points notably deviate away from the lines).

If $$p$$ is close to $$1$$, large fluctuations of the price and the production will be observed. In these cases quite often we will have lack of supply or demand. If this happens, then the efficient market maker saves the market from collapse by providing "backup" demand or supply. Note that this collapse (increase in volatility) is not observed in the original cobweb model. Furthermore the volatility will be observed even when the classical model would suggest that the market should be stable. This difference arises purely from the power of such market maker. Efficient market maker both stabilizes the market by providing "backup" demand and supply, but also destabilizes the market by overreacting to the excess demand and supply generated by the endogenous agents.

Conclusion? While the cobweb model framework clearly fails to predict the dynamics of the combined model, these failures are easy to understand. Furthermore, I am not very happy with the approach I took here (as in reality there are no efficient and omnipotent market makers). So no conclusions this time.

## Interactive app

We invite you to explore the interactive app below. Feel free to check our intuition as well as develop your own.

## Disclaimer

Note that this model is a product of my inquiries to the nature of the cobweb model. This exploration might not make a lot of sense to a person more familiar with Economics than myself.