1 Introduction

Kiyotaki and Wright (Kiyotaki and Wright 1989, 1993), henceforth KW, have famously proposed a model of commodity money emergence within a search-theoretical structure. In this model individuals are divided by their type, meaning the sort of goods they wish to consume, which differs from the type of goods they actually produce. This configuration, in association with a pairwise matching mechanism, prevents double coincidence of wants. The goal of individuals is then to adopt exchange strategies that will remedy this friction. In the original KW model (Kiyotaki and Wright 1989), a commodity is commonly accepted as a medium of exchange if it can fulfil alternative functions within the exchange structure: either it has a lower storage cost than other goods, even though it is not a commodity that an individual wishes to consume, or it has a more costly storage cost but the individual anticipates its future marketability. In the first case, the commodity is then accepted for this fundamental or absolute property of minimizing immediate costs, but the individual remains blind to potential future opportunities of exchange through other means.

This simple fundamental short-term strategy is sufficient for exchange to take place by means of a commonly adopted medium. But a commodity that is costly to store can also be systematically accepted and thereby adopted as a common medium of exchange, provided it meets the expectation that it will generally be accepted in future exchanges. The fact that an individual has previously accepted it on the basis of this expectation makes that good, in KW’s model, a so-called speculative good, and its systematic acceptance in exchange rounds a so-called speculative equilibrium. It has been shown experimentally that individuals are able to learn to efficiently speculate in a KW environment (Duffy 2001; Duffy and Ochs 1999). It is also possible to retrieve the cognitive parameters, using Q-learning as a basic heuristic, under which individuals best learn to speculate. Furthermore, Lefebvre et al. (2018) have shown the predictive power of temporal difference learning and a learning mechanism based on the computation of the costs of missing speculative opportunities to account for KW speculative behaviour. Therefore, in this case speculation is thought of in the basic sense of accepting a costly good now, thereby incurring a significant opportunity cost, in the expectation of future returns. This is the model-dependent sense of speculation that we adopt in this article, with the view that it may shed light on the typical patterns of corresponding fundamental (immediate consumption) and speculative strategies in a stylized wine market. We adopt this wine-framework as a paradigm for commodity markets in which trade occurs among goods which present uncertain qualitative developments across time.

Adopting and adapting a KW search-theoretical framework to the analysis of some stylized features of such an idealized wine market requires some qualification. First, the application is relevant because we can define different types of players in that market that fit within a KW ternary structure. In particular, the three types that we distinguish are the producer, the merchant (or French “négociant”) and the consumer. Each player produces a certain commodity that will or will not be accepted across binary matches, which we respectively characterize as money, young wine and old wine. Money can constitute an obvious medium of exchange in this framework since it is always available, especially if short-term non-speculative strategies are privileged, while another good, young wine, can be selected as a speculative medium for exchange. Different types of players, and different players within their respective types, can behave heterogeneously with respect to speculation. This has been documented in the wine market by studies such as Czupryna and Oleksy (2015) and Fernandez-Perez et al. (2019).

Our intention is to uncover some speculative strategies in the wine market that the basic KW structure and its specific notion of speculation can make salient. In this paper, we are interested in two main questions. The first one is to understand what drives speculative behaviour in the wine market in the sense that a young wine, which cannot be consumed, is bought by a consumer and left to mature in the expectation of improvement. In our adapted setting, not all agents prefer or can speculate in that sense. A speculative behaviour for a producer is to let a young wine mature prior to sale instead of being sold immediately. A speculative behaviour for a merchant is to refrain from buying a young wine. Both speculative behaviours are driven by the same uncertainty factor affecting the potential evolution of young wines. Interestingly, this natural feature of wine production can be related to specific KW models, including perishable goods. Young wines can spoil or they can improve with time. This partially indeterminate intrinsic feature of wine may be regarded as a crucial feature governing wine speculation (Ashenfelter 2008) and leads to early sales of young wines (Mahenc and Meunier 2006).

Cuadras-Morató (1997) introduces perishable goods in a KW model in terms of the number of periods in which the goods can be consumed without loss of utility. Extant KW models with perishable goods do not introduce an uncertainty parameter concerning the perishability or durability of the good, let alone its potential qualitative variation, which is usually known in advance. Instead of perishing, it could be the case that a good increases its utility consumption across periods (good wine). Moreover, we can suppose that such uncertainty is asymmetrical for the different types of agents. We could alternatively model this fact in terms of probability of survival (non-decay), but it is also possible to consider, for simplicity and greater realism (Garde-Cerdán and Ancín-Azpilicueta 2006), that the durability of a wine is increased by its storage conditions, which is a feature we introduce in our model. Producers and merchants, in particular, can be considered to have better storage conditions or cellars, which increases the chance of the wine to survive a maturation period.

The second issue that our adaptation of a KW framework to the wine market allows us to explore is the influence of the relative proportion of types (producers, consumers, and merchants) to the level of speculation in the market and to the welfare of its different segments. In another KW setting with perishable goods, Kawagoe (2009) shows that lack of information about the distribution of three goods in a KW structure, one of which is perishable, is detrimental to the emergence of an equilibrium in which the perishable good is used as a means of exchange. This underlines the fact that knowledge concerning this distribution seems to be a crucial factor for the acceptability of such a nondurable good in exchanges. In our setting, agents learn progressively about the exchangeability and perishability of young wines. Nevertheless, this partial information does not prevent young wine from being adopted as a medium of exchange in some speculative strategies. We systematically analyse how a relative increase of a given type affects the propensity to speculate, as well as the general welfare of all types within the population. One of our main results concerns the role of merchants and can therefore indicate optimal regulation policies, as regards their admissible numbers in the wine market. We thus observe that merchants tend to endorse the role of speculators when they are more numerous than producers, whereas if the number of consumers increases in turn, speculation then tends to be left to the producers. The level of speculation in the KW wine market directly affects the general welfare of the population and of its different sectors. Interestingly, the average welfare of consumers is higher under speculation than non-speculation, whereas the opposite is true for producers. Producers have an incentive to sell their stocks as soon as possible, but this result is modulated by the proportion of merchants in the population.

A unique feature of the wine market is its diversity in terms of products, the large variety of wines and producers, their cultivating methods, their personal talent, (Brand 2019). Our model ideally ought to reflect or flexibly adapt to this diversity. It is clear that it captures a general structure which is common to many local markets: winegrowers or producers, négociants or merchants, and, finally, consumers, some of them engaging in speculative strategies, engage in the trading of a volatile and intrinsically uncertain good. Some local markets, however, certainly offer greater stability, both in their organization, in their stable economic performance over the years and decades, and in terms of the role played by the major actors therein. This is indeed the case for the Bordeaux region. The local actors are well-established, which fits well with the types that our model implements. This is true in particular for the strategic competition between winegrowers and merchants, which has been documented in this region, (Patchell 2016). Moreover, unless disrupted by external forces, such as new entrants at a high cost or large-scale speculative strategies, this market presents a regular pattern of bilateral exchanges: some producers sell to affiliated merchants, and amateurs are well identified and active. Fairs, such as the VinExpo fair organized in Bordeaux, do in fact strictly reflect the ternary structure of a Kiyotaki-and-Wright model by virtue of physical proximity and meetings in a temporarily centralized location for the three types of agents involved, (Bélis-Bergouignan et al. 2011). In this sense, our model is conceived as a qualitative analysis of some very typical and prevalent local wine markets. It would require a different focus, but certainly one that is envisioned in further applied work, to turn it into a predictive econometric analysis using the real data for those markets.

In Sect. 2 we detail our analytical model and the manner in which we have adopted the original KW search-theoretical framework to our stylized wine market. Agents, strategies and possible equilibria are defined. In particular, we specify what speculation amounts to for each type of agent. In Sect. 3 we link our model to the perishability issue that has already been incorporated, within a KW setting in the past. As specified above, the main innovation here is that a given commodity—i.e. young wine—is not deterministically perishable and we define a dependency between its degree of perishability or durability and its storage conditions. Another new aspect which we introduce is that a commodity—young wine, once again—can increase its utility of being consumed if it happens to be durable. In this section we present our methodology for performing simulations. Section 4 presents our results, firstly in terms of the prevalence of speculative behaviours according to types and other parameters, and secondly in terms of welfare accrued by speculating in the KW wine market. Section 5 provides the conclusion and offers several perspectives and alternative approaches to further explore qualitatively transformable goods markets in search-theoretical terms.

2 Analytical Model

In this section we present the adaptation of a Kiyotaki-and-Wright model to a stylized wine market.

2.1 Agents

We consider three kinds of agents in our model: (1) producer, (2) merchant (French: négociant) and (3) consumer. The agents exchange three kinds of goods: (1) money, (2) young wine, and (3) old wine. The difference from the original model is that the young wine matures and becomes old wine (with a certain degree of probability in a more general approach) after one period. Each agent can only hold one unit of good at a time.

Our three types of agents—producers, merchants, and consumers—similarly to basic classical Kiyotaki-and-Wright models, (Kiyotaki and Wright 1989, 1993) are motivated by minimizing a trading search process. At each round (subsequent simulation step) all the agents are paired. Each agent in the pair can either accept or decline immediate exchanges at different costs incurred. In particular, if they anticipate future selling or buying opportunities at lower costs than present, we assert that they are adopting a speculative strategy. When adopting a speculative strategy, agents can have exchanged a good they hold for another one that they do not wish to consume immediately and then retain this for use in a subsequent trading event.

The model environment consists of N agents specialized in terms of consumption and production, in such a manner that there is initially no double coincidence of wants. Each type is, more precisely, defined by what it produces and wishes to consume and can obtain by exchanging either the good it produces or the good it currently stores. The ultimate goal of agents—that is, to consume—may then require multiple steps to be achieved. In our case, agents may wish to “consume” money, young wines or old wines, which are the three types of goods in circulation. Interestingly the multiple-step structure of the environment, due to the absence of double coincidence of wants and the possibility of speculation due to differential opportunity costs at different periods, provides a rationale to the economic role of intermediaries such as merchants.

In the description model we stick to the original notation, so that the first number in the subscript denotes an agent and the second number a traded good.

Producer In our model, the producer produces one unit of young wine and is interested in a unit of money. If a producer finds a trade partner interested in such an exchange he receives money and immediately produces one unit of young wine. This brings him a utility value \(u_1\). If a producer cannot find a trade partner then he incurs a storage cost \(c_{12}\) and the unit of stored wine matures. In the next round, a producer seeks a partner to trade a unit of old wine for money. If he manages to find such a partner, this produces a utility \(u_1^{*}\) and \(u_1^{*}>u_1\). Otherwise, a producer incurs the storage cost \(c_{13}\). The producer may only hold young or old wine, (\(p_{12}\) denotes the share of producers holding a young wine and \(p_{13}\) the share of producers holding an old wine, \(p_{12} + p_{13}= 1\)) and may also employ two strategies – fundamental and speculative. Within these two strategies a producer would like to exchange:

  • Fundamental: young or old wine for money

  • Speculative: only old wine for money

To be compatible with the original KW model, we treat money as a kind of regular good (agents exchange one unit of money against one unit of either young or old wine). Thus, we do not model the young or old wine prices in an explicit way. However, the difference between \(u_1^{*}\) and \(u_1\) can be interpreted as the difference in prices between a unit of old wine and a unit of young wine. Thus, the price difference between old and young wine is considered (in an implicit way) in agents’ utilities for all types of agents. We can interpret in an analogous way the utility \(u_2\) for a merchant and the difference between \(u_3^{*}\) and \(u_3\) for a consumer. Given that agents always exchange one unit of a particular good, we will refrain from using the term “one unit”, when describing an exchange between agents, for the sake of brevity. Allowing an agent to hold more units of a particular good represents a potential extension of the model.

Merchant Similarly, a merchant is interested in trading. In particular, if a merchant holds a unit of money, he is interested in obtaining a unit of young wine. If a merchant cannot find a trade partner he pays a storage cost \(c_{21}\) for a unit of money stored. However, if a merchant finds a trade partner interested in such an exchange he receives a young wine. A young wine matures and changes to an old wine, which can subsequently be traded in the next round. Despite this, the merchant must pay a storage cost \(c_{23}\). In such a case, in the next round, a producer seeks a partner to trade an old wine for money. If he manages to find such a partner, this brings him a utility \(u_2\). Otherwise, a merchant pays the storage cost \(c_{23}\). Merchants may only hold money or an old wine (\(p_{21}\) denotes the share of speculators holding money, and \(p_{23}\) the share of speculators holding an old wine, \(p_{21} + p_{23}= 1\)) and may also play two strategies fundamental and speculative. Within these strategies a merchant would like to exchange:

  • Fundamental: money for young or old wine

  • Speculative: holds money (refrains from trading)

Consumer In our model, the consumer holds one unit of money and is interested in consuming one unit of an old wine. If a consumer finds a trade partner interested in such an exchange he receives one unit of an old wine that is immediately consumed, and a unit of money is provided to the producer. This brings him a utility value \(u_3\). If a consumer cannot find a trade partner he incurs a storage cost \(c_{31}\). A consumer may also be interested in buying a young wine. In this case, the consumer pays a storage cost \(c_{32}\) and the wine matures. In the next round, the consumer consumes an old wine and immediately a unit of money is provided to him. This brings him a utility value \(u_3^{*}\). In this round, a consumer who is not interested in buying another unit of an old wine may nonetheless purchase a young wine. A consumer may only hold money and young wine: (\(p_{31}\) denotes the share of consumers holding money, and \(p_{32}\) the share of consumers holding a young wine, (\(p_{31} + p_{32}= 1\)). It is worth mentioning that at the beginning of the next round a (unit of) young wine has already matured and so becomes an old wine. This wine has been consumed and a unit money has been tendered. Despite the fact that all consumers hold a unit of money at the beginning of the period, they may be in one of two states, depending on whether they have already consumed an old wine (matured young wine from the previous round) or not (money was retained in the previous round also). Therefore, we distinguish these two groups of consumers and use symbols \(p_{31}\) and \(p_{32}\) to represent their relative shares in the consumer population. The consumer may also employ two strategies: fundamental and speculative. Within these strategies a consumer would like to exchange:

  • Fundamental: money for old wine

  • Speculative: money for young or old wine.

2.2 Fundamental Equilibrium

In the fundamental equilibrium, all agents employ their fundamental strategies. The goods exchanged between pairs of agents in this equilibrium are presented in Fig.  1. The numbers in squares denote the agent’s type; otherwise the type of good. Agents of all types (labelled 1, 2, 3 in Fig. 1) always accept their consumption good and refuse to trade when proposed the same good that they are already storing or when the partner is of the same type, regardless of the good that the latter is storing. In those cases in which they are proposed a good that they neither produce nor consume, types 1, 2 and 3 agents use the fundamental strategies specified previously.

Fig. 1
figure 1

Fundamental equilibrium. Agents: 1–producer, 2–merchant, and 3–consumer. Goods: 1–money, 2–young wine, and 3–old wine

In the following paragraphs, we will analyse the agents’ problems and the equilibrium distribution. As in the original model, we denote by \(V_{ij}\) the value for the agent type i of having a good of type j after a trade. We assume that a discount factor value is \(\beta\) and that agent types are equally distributed. We also use the symbol b, where \(b=\beta /3\), as in the original KW model.

The producer problems are as follows:

$$\begin{aligned} V_{12} = -c_{12} + b \left( V_{13} + p_{21} \times {\text {max}}(u_1+V_{12},V_{13}) +p_{23} V_{13} + V_{13} \right) \end{aligned}$$
(1)

In Eq. 1 in brackets (from left to right) \(V_{13}\) is the value when paired with another producer, \({\text {max}}(u_1+V_{12},V_{13})\) when paired with a merchant having money, \(V_{13}\) when paired with a merchant having old wine, and \(V_{13}\) when paired with a consumer.

$$\begin{aligned} V_{13} = -c_{13} + b \left( V_{13} + V_{13} + u_1^{*} + V_{12} \right) \end{aligned}$$
(2)

The producer will apply a fundamental strategy if \(u_1 + V_{12} > V_{13}\). We do not consider equality in the previous equation (an agent is indifferent) but this can be easily done by, for instance, assuming that an agent always utilises a fundamental strategy when indifferent. This is valid (we used the equality \(p_{21}+p_{23}=1\)) iff:

$$\begin{aligned} u_1-c_{12}+c_{13} + b \left( u_1-u_1^{*} \right) > 0 \end{aligned}$$
(3)

Whether or not a producer employs the fundamental strategy is determined by the utility of selling a young wine plus the difference in storage cost of young and old wine and the discounted difference between the utilities of selling young and old wine.

The merchant problems are as follows:

$$\begin{aligned} V_{21}= & {} -c_{21} + b \left( p_{12} \times {\text {max}}(V_{21},V_{23}) +p_{13} V_{21} + V_{21} + V_{21} \right) \end{aligned}$$
(4)
$$\begin{aligned} V_{23}= & {} -c_{23} + b \left( V_{23} + V_{23} + u_2+V_{21} \right) \end{aligned}$$
(5)

The merchant will use a fundamental strategy if \(V_{23} > V_{21}\). This is valid iff:

$$\begin{aligned} c_{21}-c_{23} + b u_2 > 0 \end{aligned}$$
(6)

Whether or not a merchant employs the fundamental strategy is determined by the utility of trading a wine (buying a young wine and selling an old wine) plus the difference in the storage cost of money versus storing an old wine.

The consumer problems are as follows:

$$\begin{aligned} V_{31}= & {} -c_{31} + b \left( p_{12} \times {\text {max}}(V_{31},V_{32}) +p_{13} (u_3+ V_{31}) + p_{21} V_{31} + p_{23} (u_3 + V_{31}) + V_{31}\right) \end{aligned}$$
(7)
$$\begin{aligned} V_{32}= & {} -c_{32} + b \left( 3 u_3^{*}+p_{12} \times {\text {max}}(V_{31},V_{32}) + p_{13} V_{31} + V_{31} + V_{31} \right) \end{aligned}$$
(8)

The consumer will play a fundamental strategy if \(V_{31} > V_{32}\).

This is valid iff:

$$\begin{aligned} -c_{31}+c_{32} + b \left( (p_{13}+p_{23})u_3 - 3 u_3^{*}\right) > 0 \end{aligned}$$
(9)

Whether or not a consumer employs the fundamental strategy is determined by the difference in the storage cost of money and a young wine and the discounted difference between utilities derived from old wine consumption in both cases: direct purchase of an old wine and purchase of a young wine followed by the maturation process. The former utility is additionally multiplied by the probability of buying an old wine in the next round (equals the sum of probabilities of meeting a producer and a merchant having an old wine).

From Eq. 7 we can also obtain:

$$\begin{aligned} V_{31} = \frac{-c_{31} + b \left( (p_{13} + p_{23}) u_3\right) }{1-\beta } \end{aligned}$$
(10)

The equilibrium stable distribution, which is the solution of the relevant transition matrices (Eqs. 11 and 12), and also taking into account fact that a consumer can only hold money, is \(p_{12} = \frac{\sqrt{5}-1}{4}, p_{21} =3-\sqrt{5}, p_{31} = 1\).

$$\begin{aligned}&\begin{bmatrix} p_{12}&p_{13} \end{bmatrix} \begin{bmatrix} p_{21}/3 &{} 1-p_{21}/3 \\ 1/3 &{} 2/3 \end{bmatrix} = \begin{bmatrix} p_{12}&p_{13} \end{bmatrix} \end{aligned}$$
(11)
$$\begin{aligned}&\begin{bmatrix} p_{21}&p_{23} \end{bmatrix} \begin{bmatrix} 1-p_{12}/3 &{} p_{12}/3 \\ 1/3 &{} 2/3 \end{bmatrix} = \begin{bmatrix} p_{21}&p_{23} \end{bmatrix} \end{aligned}$$
(12)

2.3 Producer Speculative Equilibrium

Now we consider the producer’s speculative equilibrium (a producer that sells old wine is playing a speculative strategy). Other agents play the fundamental strategy. The equilibrium is rather simple: only old wine is traded directly between producers and consumers. The goods exchanged between pairs of agents in this equilibrium are presented in Fig. 2. Merchants do not participate in the market.

Fig. 2
figure 2

Producer speculative equilibrium. Agents: 1–producer, 2–merchant, and 3–consumer. Goods: 1–money, 2–young wine, and 3–old wine

The producer’s problems are as follows:

$$\begin{aligned} V_{12}= & {} -c_{12} + b \left( V_{13} + {\text {max}}(u_1+V_{12},V_{13}) + V_{13} \right) \end{aligned}$$
(13)
$$\begin{aligned} V_{13}= & {} -c_{13} + b \left( V_{13} + V_{13} + u_1^{*} + V_{12} \right) \end{aligned}$$
(14)

The producer will play a speculative strategy if \(u_1 + V_{12} < V_{13}\). This is valid iff:

$$\begin{aligned} c_{12}-c_{13} + b u_1^{*} - (1+b) u_1 > 0 \end{aligned}$$
(15)

The equilibrium stable distribution is a solution of the relevant transition matrix (see Eq. 16). It takes into account the possibility that both a merchant and consumer may only hold money and is equal to \(p_{12} = 1/4, p_{21}=1, p_{31} = 1\).

$$\begin{aligned} \begin{bmatrix} p_{12}&p_{13} \end{bmatrix} \begin{bmatrix} 0 &{} 1 \\ 1/3 &{} 2/3 \end{bmatrix} = \begin{bmatrix} p_{12}&p_{13} \end{bmatrix} \end{aligned}$$
(16)

2.4 Consumer Speculative Equilibrium

Now we consider the consumer speculative equilibrium (a consumer who speculates buys both young and old wine). Other agents employ the fundamental strategy. The exchange of goods between pairs of agents in this equilibrium is presented in Fig. 3.

Fig. 3
figure 3

Consumer speculative equilibrium. Agents: 1–producer, 2–merchant, and 3–consumer. Goods: 1–money, 2–young wine, and 3–old wine

The producer problems are as follows:

$$\begin{aligned} V_{12}= & {} -c_{12} + b \left( V_{13} + p_{21} \times {\text {max}}(u_1+V_{12},V_{13}) +p_{23} V_{13} + {\text {max}}(u_1+V_{12},V_{13}) \right) \end{aligned}$$
(17)
$$\begin{aligned} V_{13}= & {} -c_{13} + b \left( V_{13} + V_{13} + p_{31} (u_1^{*} + V_{12}) + p_{32}V_{13} \right) \end{aligned}$$
(18)

The producer will play a fundamental strategy if \(u_1 + V_{12} > V_{13}\). This is valid iff:

$$\begin{aligned} u_1-c_{12}+c_{13} + b \left( p_{31} (u_1-u_1^{*}) \right) > 0 \end{aligned}$$
(19)

Merchant problems remain the same as in the case of fundamental equilibrium, however Eq. 5 must be adapted analogously as Eq. 18 in case of producer. Consumer problems remain the same as in the case of fundamental equilibrium.

The equilibrium stable distribution is a solution of the relevant transition matrices (Eq. 2021, and 22). It was calculated numerically using the SageMath (The Sage Developers (2019)) program and is equal to \(p_{12} = 0.3976, p_{21} = 0.6857, p_{31} = 0.8675\).

$$\begin{aligned}&\begin{bmatrix} p_{12}&p_{13} \end{bmatrix} \begin{bmatrix} 1/3+p_{21}/3 &{} 2/3 -p_{21}/3 \\ p_{31}/3 &{} 1-p_{31}/3 \end{bmatrix} = \begin{bmatrix} p_{12}&p_{13} \end{bmatrix} \end{aligned}$$
(20)
$$\begin{aligned}&\begin{bmatrix} p_{21}&p_{23} \end{bmatrix} \begin{bmatrix} 1-p_{12}/3 &{} p_{12}/3 \\ p_{31}/3 &{} 1-p_{31}/3 \end{bmatrix} = \begin{bmatrix} p_{21}&p_{23} \end{bmatrix} \end{aligned}$$
(21)
$$\begin{aligned}&\begin{bmatrix} p_{31}&p_{32} \end{bmatrix} \begin{bmatrix} 1-p_{12}/3 &{} p_{12}/3 \\ 1-p_{12}/3 &{} p_{12}/3 \end{bmatrix} = \begin{bmatrix} p_{31}&p_{32} \end{bmatrix} \end{aligned}$$
(22)

2.5 Perishability

The maturation process is complex and requires a great deal of knowledge and experience. Therefore, the wine can get spoilt in such a process. It also natural to assume that the probability of successful transformation is highest for producers and lowest for consumers.

To model this feature we implement the relevant parameters, which denote the probability of successful transformation from the young wine to the old wine, \(s_1, s_2>s_3\). Thus, the problems of agents need to be updated. We do this only for the fundamental equilibrium as an example. We assume that if a young wine becomes spoilt then the producer simply produces another one (loss just means that no utility is retrieved), the merchant suffers a loss (\(l_2\)) and the consumer also suffers a loss (\(l_3\)).

$$\begin{aligned} V_{12}= & {} -c_{12} + b \left( s_1 V_{13} + (1-s_1) V_{12} + p_{21} \times {\text {max}}(u_1+V_{12},s_1 V_{13} + (1-s_1) V_{12}) \right) \nonumber \\&+b \left( p_{23} (s_1 V_{13} + (1-s_1) V_{12}) + s_1 V_{13} + (1-s_1) V_{12} \right) \end{aligned}$$
(23)
$$\begin{aligned} V_{13}= & {} -c_{13} + b \left( V_{13} + V_{13} + u_1^{*} + V_{12} \right) \end{aligned}$$
(24)

The merchant problems are as follows:

$$\begin{aligned} V_{21}= & {} -c_{21} + b \left( p_{12} \times {\text {max}}(V_{21},s_2 V_{23} + (1-s_2) (V_{21}-l_2) +p_{13} V_{21} + V_{21} + V_{21} \right) \end{aligned}$$
(25)
$$\begin{aligned} V_{23}= & {} -c_{23} + b \left( V_{23} + V_{23} + u_2+V_{21} \right) \end{aligned}$$
(26)

The consumer problems are as follows:

$$\begin{aligned} V_{31}= & {} -c_{31} + b \left( p_{12} \times {\text {max}}(V_{31},V_{32}) +p_{13} (u_3+ V_{31}) + p_{21} V_{31} + p_{23} (u_3 + V_{31}) + V_{31}\right) \end{aligned}$$
(27)
$$\begin{aligned} V_{32}= & {} -c_{32} + b s_3 \left( 3 u_3^{*}+ p_{12} \times {\text {max}}(V_{31},V_{32}) + p_{13} V_{31} + V_{31} + V_{31}\right) \nonumber \\&+ b (1-s_3) \left( -3 l_3+ p_{12} \times {\text {max}}(V_{31},V_{32}) + p_{13} (u_3+V_{31}) + p_{21} V_{31} + p_{23} (u_3+V_{31}) + V_{31}\right) \end{aligned}$$
(28)

3 Simulations

The model is implemented in Java, using the MASON 19 framework. We represented 10,000 agents in the model, divided into producers, merchants and consumers. The total numbers of each agent group are parametrized. (\(N_P\)—number of producers, \(N_M\)—number of merchants and \(N_C\)—number of consumers). We also analysed 5000 different parameter sets (for the parameters described above) by systematically searching the parameter space using the Sobol numbers (Bratley and Fox 1988; Christophe and Petr 2014). We run 2 simulations for each parameter set, thus we have explored 10,000 simulations in total.

3.1 Agents

As in the original KW model, in each period (simulation step) agents meet in pairs and decide whether to exchange the goods possessed. Thus, for each agent we consider the states in which the agent may be, based on the current good possessed by the agent and his/her trading partner. For example, state (1, 3) means that the agent holds a unit of money and his/her trading partner a unit of old wine. In each state, agents decide whether they wish to trade. If both agents want to trade then an exchange takes place. For each agent type, the relevant states and strategies are presented in Table 1. It is important to mention that we assume that a consumer in possession of a young wine from the previous step, drinks it (if it was successfully matured) and money is immediately provided to him. However, the consumer is not interested in acquiring another bottle of old wine, whether to store or consume it, but is potentially interested in buying another bottle of young wine. A consumer being in a state 2 at the beginning of the next round (after having consumed a matured young wine and having money) is regarded as being in a state 1 (having money) by other agents. The other agents do not recognize which state the agent is in, 1 or 2.

Table 1 Agent strategies

We assume that like goods are not traded (e.g. money is not exchanged for money) and that agents of the same type do not trade among themselves (if one of them is better off, another must be worse off), as in the original KW model.

We assume that producers are always willing to exchange an old wine for money (at the next possible trading opportunity), as otherwise storing an old wine forever would be better than respectively selling it (producer now produces and holds young wine), producing an old wine (producer now holds old wine after maturation of young wine from a previous round) and ultimately keeping an old wine forever. The possibility that a young wine can get spoilt in the maturation process is also taken into account. We exclude this by the following assumption, see Eq. 29.

$$\begin{aligned} -\frac{c_{13}}{1-\beta } \le u_1^* - \left( c_{12} + s_1 \beta \times \frac{c_{13}}{1-\beta }\right) \times \frac{1}{1-(1-s_1)\beta } \end{aligned}$$
(29)

A producer also does not exchange old wine for a young wine (such an exchange could only be done with another producer). Similarly, in the case of an exchange of young wine for an old wine (such exchange is also potentially possible with a merchant who is nonetheless uninterested in such an exchange). In a similar manner, we can show that it is optimal to trade or not to trade in the obvious states for a merchant and a consumer. We assume that a merchant is always willing to exchange an old wine for money (at the next possible trading opportunity), as otherwise storing an old wine forever would be better than selling it and retaining the money. A merchant is also not interested in exchanging an old wine for a young wine. This can only make a merchant worse off because of perishability. We assume that a consumer is always willing to exchange money for an old wine at the next possible trading opportunity. Otherwise, storing money forever would be better for a consumer than drinking the wine and holding money indefinitely (which is excluded as drinking an old wine gives a consumer positive utility).

3.2 Q-Learning Mechanism

The question marks in Table 1 means that the agent may potentially apply two different strategies: to exchange or not to exchange. The agents learn the appropriate strategy during the simulation. For this purpose, we have implemented the q-learning model, Watkins and Dayan (1992).

In particular, we assume that the agent is in state \(s_t\) in simulation step t, where the possible actions \(a_t\) of the agent is to exchange the goods—\(a_1\) or not to exchange goods—\(a_0\), and the agent is in state \(s_{t+1}\) in simulation step \(t+1\). The action taken depends on the agent’s preferences (whether he/she wants to exchange the goods or not) and the preferences of the other agent involved in the potential exchange. The agent learns the preferences based on the observed pay-off, which is a consequence of the previous step action. Then the agent updates his pay-off from employing strategy a in state \(s_t\), based on the results, using the formula:

$$\begin{aligned} Q^n(s_t,a_t)=(1-\alpha ) Q^o(s_t,a_t) + \alpha \left( r_t + \beta {\text {max}}_a Q(s_{t+1},a) \right) \end{aligned}$$
(30)

where \(\alpha\)—learning rate and \(\beta\)—discount factor are the simulation parameters. The reward \(r_t\) is the sum of storage cost and potential immediate utility from exchanging the goods. When the agent is in a given state for the first time, we set an initial value for the pay-off for utilising the strategy a in a given state, using the formula:

$$\begin{aligned} Q^n(s_t,a_t)= r_t + \beta {\text {max}}_a Q(s_{t+1},a) \end{aligned}$$
(31)

We have applied simulated annealing for the learning process. In particular, the total number of the simulation steps in each simulation is \(400 \times 24\), where 400 is the number of simulation steps in a single block and 24 the number of blocks. In the first three simulation blocks, agents played randomly (each action with an equal probability of 0.5). In the next 19 blocks, the probability of playing a particular strategy was defined by the softmax formula 32, where we allowed for \(T \in [10,9,...,1,1/2,...,1/10]\).

$$\begin{aligned} p(s,a_0) = \frac{e^{Q(s,a_0)/T}}{e^{Q(s,a_0)/T} + e^{Q(s,a_1)/T}} \end{aligned}$$
(32)

In the simulation, in blocks 23 and 24 only the optimal strategy (the one with the highest pay-off) was employed. However, only in block 24 were the results recorded.

3.3 Parameters

For comparability of the results among agents, we have assumed that \(u_2 = u_1^{*} - u_1\), i.e. the utility from selling an old wine by a merchant equals the difference in the utilities of selling the old and young wine by a producer. Similarly, \(l_2 = -u_1\), the loss for a merchant when wine becomes spoilt in the maturation process equals the utility of selling a young wine by a producer. Similarly, for a consumer, the utility difference between drinking a young wine that has matured (into an old wine) and an old wine bought directly equals the difference in utilities of selling the old and the young wine by a producer \(u_3^{*} - u_3 = u_1^{*} - u_1\). Similarly, \(l_3 = -u_1\) , so that the loss for a consumer when wine is spoilt in the maturation process equals the utility of selling a young wine by a producer.

The raw parameter ranges are shown in Table 2. The final parameters are obtained by transformation of the preliminary parameter ranges. In particular, the preliminary parameters for the numbers of producers, merchants, and consumers are first normalised to one and then multiplied by the total number of agents in the simulation. For merchants and consumers, wine storage (of an old and young wine respectively) is increased by the money storage cost of the relevant agent (preliminary parameters are the incremental differences). Similarly, the utility of an old wine is increased by adding the utility of a young wine. For both producer and merchant, maturation success probabilities are calculated by subtracting perishability parameters from 1. For a consumer, the success probability is calculated as the difference between the minimum success probabilities for a producer and merchant and the respective perishability preliminary parameter.

Table 2 Raw parameter ranges

4 Results

In the first subsection we show how the different parameter values influence the agent’s propensity to speculate. Then in the next subsection we show how these parameters influence the welfare of the agents.

4.1 Speculative Behaviour

First we present the linear regression results of the proportion of agents in each agent type that learned to speculate. The explained variables are constructed as an arithmetic average over the values observed in all simulation steps in the final simulation block.

Producers The regression results of the percentage of producers that speculate according to the simulation parameters are presented in Table 3.

Table 3 Percentage of producers that speculate

We can observe that the higher the number of merchants per producer, the lower is the percentage of producers speculating (maturing the young wine). Merchants take over the wine maturation process. In contrast, the higher the number of consumers per producer, the higher the percentage of producers who speculate. Old wine storage cost decreases the degree of speculation (matured wine must be held by a producer and storage cost must be paid) while young wine storage cost increases the level of speculation among producers (after selling a young wine, a producer immediately produces a new unit of young wine and again pays a young wine storage cost). The additional pay-off from speculation (maturing a wine) depends on the difference between the utilities from selling old wine and from selling the young wine. Therefore, the higher the utility from selling the old wine, the higher the speculation and, conversely, the higher the utility from selling the young wine, the lower the speculation. Higher values of \(\beta\)—lower discounting—increase the level of speculation (it is easier for a producer to give up immediate pay-off from selling a young wine). Higher values of the parameter \(\alpha\) (short term memory) reduce speculative behaviour. Furthermore, lower perishability increases speculative behaviour.

Merchants Regression results of the percentage of merchants that speculate according to the simulation parameters are presented in Table 4.

Table 4 Percentage of merchants that speculate

We can observe that the higher the number of producers per merchant the higher is the percentage of merchants speculating (not buying a young wine, withdrawing from the market). On the contrary the higher the number of consumers per merchant the lower percentage of merchants speculate, more merchants stay in the market. Old wine storage cost increases the speculation (trading becomes more costly) while money storage cost (cost of not trading are increased) decreases the speculation among merchants. Similarly, as in the case of wine maturation by producers, the trading pay-off depends on margin, which is the difference between utilities from selling old wine and from selling the young wine. Therefore, the higher the utility from selling the old wine the lower the speculation and on the contrary the higher the utility from selling the young wine the higher the speculation. Higher values of \(\beta\)—lower discounting—decrease the speculation (a merchant is more patient when waiting for an occasion to sell an old wine). Higher values of the parameter \(\alpha\) (short term memory) increase speculation behaviour. Also, lower perishability decreases the speculative behaviour.

Consumers Regression results of the percentage of consumers that speculate (buy a young wine having money or buys a young wine having already a young wine from the previous step) on the simulation parameters are presented in Table 5.

Table 5 Percentage of consumers that speculate

We can observe that the higher the number of producers per consumer the lower is the percentage of consumers speculating (buying a young wine and maturing a wine by themselves). Similarly, the higher the number of merchants per consumer the lower percentage of consumers speculate. In both previous cases it is easier to buy an old wine on the market. Young wine storage cost decreases the speculation (storing and maturing of a young wine is more costly) while money storage cost (cost of not buying a young wine are increased) increases the speculation among consumers. Similarly, as in case of wine maturation by producers and trading by merchants, the maturation marginal pay-off depends on the difference between utilities from drinking an old wine (that was previously bought as an old wine) and an old wine, that was originally bought as a young wine and matured by himself. Therefore, the higher the utility of an old wine (which constitutes the price of an old wine for a consumer) the higher the speculation and on the contrary the higher the utility of a young wine (which constitutes the price of an old wine for a consumer) the lower the speculation. Higher values of \(\beta\)—lower discounting—decrease the speculation (a consumer is more patient when waiting for an occasion to buy an old wine). Higher values of the parameter \(\alpha\) (short term memory) increase speculation behaviour. Also, lower perishability increases the speculative behaviour. However, producers and merchant’s lower perishability decrease the speculative behaviour (not only the absolute value but also the difference between perishability for the different kinds of the agents matters).

The fact that a consumer learns to speculate highly depends on the learning process, parameter \(\alpha\). We consider both states:

  • s1: having money and being offered a young wine

  • s2: having a young wine (from previous step) and being offered a young wine

High values of \(\alpha\) drives learning to speculate in the state s1 and low values favour learning to speculate in the state s2.

4.2 Welfare

For producers the average pay-off (measured by the average pay-off in the last simulation block) for a non-speculative strategy was 0.3627 and was significantly higher than that for a speculative strategy (0.32202). Similarly, for merchants the average pay-off for a non-speculative strategy was 0.0194 and was significantly higher than for a speculative strategy (-0.0499). In contrast, for consumers the average pay-off was highest when speculating in both states s1 and s2 (0.2778), followed by speculating only in s1 (0.2705), speculating only in s2 (0.2383) and not speculating at all (0.2371). All of the differences described above are statistically significant, apart from the last one.

We now present the regression results of the average welfare of two types of agents, producers and consumer, on the proportion of merchants in the simulation (Table 6).

Table 6 Average welfare of agents

We can see that merchants generally decrease the average welfare. The decrease is more significant when the number of producers is higher (negative sign of the estimated value of parameter for the interaction term). Merchants increase the average welfare of the agents of the other type when wine perishability is low, in the case of a merchant (as a result of having high quality equipment, cellars and know-how), and values of the parameter \(\beta\) are high (positive sign of the estimated value of parameter for the interaction term).

We also verified non-linearity by application of generalized additive models, (Wood 2011, 2017). Results showing the average welfare in relation to the percentage of merchants (left side) and producers (right side) is presented in Fig. 4. We can observe a linear relationship in the case of merchant but a non-linear one in terms of the percentage of producers.

Fig. 4
figure 4

Average agent welfare

As the negative impact of merchants on the average pay-off of producers and consumers may be caused by merchants that speculate and do not trade (such merchants provide no added value but decrease the average number of meetings among other agents), we repeated the analysis solely for such scenarios where no merchant speculates (all remain in the market). These results are presented in Table 7.

Table 7 Average welfare of agents—all merchants speculating scenarios

In this case we can see that although merchants generally increase the average welfare, the coefficient is not significant. So, the impact of merchants depends on the interactions between the number of merchants and other parameters values. The increase is more significant when the number of producers is higher (positive sign of the estimated value of parameter for the interaction term). Merchants increase the average welfare of the agents of the other type when wine perishability is high for producers.

We also verified non-linearity by the application of generalized additive models. Results showing the average welfare in relation to the percentage of merchants (left side) and producers (right side) is presented in Fig. 5. A non-linear relationship is evident in the case of merchants and producers.

Fig. 5
figure 5

Average agent welfare—all merchants speculating scenarios

5 Conclusions and Further Research

In this paper we have analysed an adapted form of Kiyotaki and Wright model. We have identified and considered theoretically one fundamental and three speculative equilibria (depending on which type of agents speculate). Moreover, using an agent-based approach we have identified the most important factors that may influence the speculative behaviour of the agents.

The most important factors that increase the propensity of producers to speculate are as follows: a higher ratio of consumers relative to producers, the difference in utilities/prices between an old and a young wine, a higher storage cost for young wine, and the probability of having a successful maturation process. On the other hand, a higher merchants-to-producers ratio, higher discounting (lower values of the \(\beta\) parameter), a higher tendency to incorporate more recent information (higher values of the \(\alpha\) parameter), and a higher storage cost for old wine all decrease the propensity of producers to speculate.

Similarly, for merchants, a higher ratio of producers to merchants, a higher storage cost for old wine, a higher tendency to incorporate the more recent information, and higher discounting serve to increase the propensity to speculate (interpreted as not trading). In contrast, a higher ratio of consumers to merchants, the difference in utilities/prices between an old and a young wine, a higher storage cost of money (cost of not trading) and the probability of a successful maturation process all decrease the propensity of merchants to speculate.

For consumers, the difference in utilities/prices between an old and a young wine, higher discounting, a higher tendency to incorporate more recent information, a higher storage cost of money, and a higher probability of successful maturation (when conducted by the consumer) increase the propensity to speculate. In contrast, a higher ratio of producers to consumers or of merchants to consumers, a higher storage cost for young wine, a higher probability of successful maturation (when conducted by merchant or producer) decrease the propensity of consumers to speculate.

Moreover, we show that there is an optimal (in terms of the average welfare of producers and consumers) percentage of producers in a population. Merchants, on the other hand, decrease the average welfare in general but for the scenarios where it makes sense for (almost) all merchants to remain in the market. This represents a kind of self-selection mechanism.

Government intervention to the effect of regulating the wine market is well-documented and follows a diverse rationale. Recent literature in the field gives precise oversight and analysis of different potential measures (Corsinovi and Gaeta 2019; Meloni et al. 2019). It is worth emphasizing that some features (parameters) of our model are particularly suited to capturing such interventions. The different values for the numbers of producers, merchants and consumers used in the simulation enable an assessment of the impact of regulations altering these values, for example, increasing taxes and thus increasing the wine price and reducing the number of customers. The different values for the probability of successful transformation of a young wine to an old wine used in the simulation allow us to ascertain the impact of regulations concerning wine quality. More onerous demands regarding wine quality will result in a reduction of the success probabilities. To provide some further detail on this, we can add that there are also more specific actions that a government can take in order to regulate the wine market. Meloni et al. (2019) underline the role of consumption taxes, planting rights, and the use of geographical indications. Each policy once again affects the quantity and quality of the bottles that will circulate on the market, but it does so by targeting the different types of agents that we model and their respective behaviour and outputs. Consumption taxes will clearly affect the propensity to purchase wine. But this could be done differentially by taxing young wines and old wines at different levels, thereby fostering or impeding speculation on the wine market. Therefore, consumption taxes can also clearly affect the strategies of merchants and producers, which is hardly surprising given the strategic interdependencies that our model essentially stylizes. Differential planting rights immediately affect both the production capacity and the volume of the market by reducing overall consumption. In spite of this, there is no reason why this fundamentally changes the strategies of the agents and the subsequent derivation of speculative equilibria. Geographical indications, on the other hand, offers a more subtle intervention mechanism. First, it is a direct way of producing quality signals that are not subject to manipulation. Although this is not entirely reliable, due to weather conditions or other contingent circumstances, it creates strong expectations on the part of consumers which tend to limit the quantitative/qualitative leeway otherwise allowed to producers. It also provides guidance to the merchant’s choice about which wines it is worth letting age, in view of their foreseen marketability. Another interesting factor is that it points to a future extension of our model in spatial terms. To the best of our knowledge, search-theoretical models for the emergence of speculative goods have not been associated, as of yet, with spatial models of competition.

Future research should consider the potential equivalence of different ways of conceiving and modelling uncertainty about the durability of commodities within a search-theoretical framework. We introduced young wine perishability/durability as depending on asymmetric storage conditions. The eventuality of young wine becoming valuable old wine is not deterministic, since, as for any other perishable good whose future quality is uncertain. The way durability uncertainty asymmetrically affects the adoption of a particular medium of exchange could be thought in principle theoretically equivalent to asymmetric storage costs in the original Kiyotaki and Wright model. Individuals may be unwilling to incur net losses due to a good perishing before consumption, unless they enter into speculative strategies in the same manner as they do with goods that are costly to store. Another asymmetry concerns the distribution of goods, which should naturally affect, provided it is known to agents, their strategic choices. However, it is an open question as to whether speculation by means of perishable goods could be supported by further forms of asymmetry. Kawagoe (2009) has shown, in particular, that when the asymmetric distribution of goods is only partially known by the agents, the perishable good tends not to be adopted as a medium of exchange. In our setting that would mean that only money will serve for purposes of trade. Yet it remains to be tested whether asymmetric partial information would restore the possibility of speculation (and, more generally, trading) with a perishable good. It may indeed seem intuitive that our distinct agents have asymmetric access to the durability of the traded commodity. It would also be interesting to embed the search-theoretical approach within a more general model of speculation, in which such asymmetries are defined as exploitable features by rational agents. Speculation, in its more general sense, is about exploiting asymmetric knowledge. Whether asymmetries are in fact theoretically exploitable in the presence of rational Bayesian agents has been proved impossible by a series of no-trade theorems, in the aftermath of the original results obtained by Milgrom and Stokey (1982). What could make speculation possible and overcome these impossibility results is precisely a feature quite specific to the wine market, namely, the presence of heterogeneously expert agents with respect to wine quality. Information can, in principle, be shared concerning the likelihood of a young wine turning into a valuable old wine, but the heterogeneity of appraisal as to what constitutes a good wine and the subjectivity of the tasting process itself. This possibility, to our best knowledge, has not been explored analytically or numerically. Another way of stating this issue would be to say that agents have different rates of learning, in terms of the ability to appreciate a good wine for what it is, an asymmetry that has indeed been considered compatible with speculation e.g.(Marengo and Tordjman 1996).

In an alternative account of the emergence of a commodity as a medium of exchange, Banerjee and Maskin (1996) study a barter economy in which goods are produced in two qualities. We have precisely defined our economy according to this dichotomy. Our initial phase of exchange is similar to these authors’ setting, to the extent that their agents are unable to distinguish the quality of those goods which they neither produce nor consume. For consumers, the quality of the wine is revealed at the point of consumption and they cannot make ex-ante error-free prediction. Banerjee and Maskin (1996) show that the goods for which the discrepancy of quality between two instances is smallest will emerge as a medium of exchange. In contrast to this, we show that young wines, rather than old wines, i.e. wines which remain uncertain as to their quality, can emerge as media of exchange under speculative strategies. But further refinements and hybridization of the Banerjee-and-Maskin and Kiyotaki-and-Wright models could be usefully adapted to richer settings, in particular, by incorporating the fact that, within different wine appellations and different vintages, qualitative volatility remains possible, which should affect in complex ways the theoretical adoption of one of them as a medium of exchange. Further studies should also increase the degree of realism when seeking to apply the conditions of speculative equilibria of search-theoretical models to more specific commodity markets. In search-theoretical frameworks, money has been the favoured commodity to be studied, not only because it plays a central role in our economic lives and it best responds to the friction of an absence of coincidence of wants, but also because it immediately presents good intrinsic properties, such as manipulability, recognizability and durability; the exact kind of properties that are weakened in models allowing for perishability, qualitative volatility and limited perception of intrinsic value. Important studies in the search-theoretical brand of monetary economics endogenize these characteristic features of money, see (Nosal and Rocheteau 2011) for an in-depth coverage. A new focus of investigation could be to determine whether the adoption of commodities as media of exchange within speculative strategies tends to affect, in the long run, their intrinsic characteristics, for instance, in the sense of a greater qualitative homogeneity, such as might actually be the case for wine uniformization, (Mueller et al. 2001) and possibly many other consumables.