Agency theory meets matching theory

The theory of incentives and matching theory can complement each other. In particular, matching theory can be a tool for analyzing optimal incentive contracts within a general equilibrium framework. We propose several models that study the endogenous payoffs of principals and agents as a function of the characteristics of all the market participants, as well as the joint attributes of the principal–agent pairs that partner in equilibrium. Moreover, considering each principal–agent relationship as part of a market may strongly influence our assessment of how the characteristics of the principal and the agent affect the optimal incentive contract. Finally, we discuss the effect of the existence of moral hazard on the nature of the matching between principals and agents that we may observe at equilibrium, compared to the matching that would happen if incentive concerns were absent.


Introduction
The optimal design of incentives is a prevalent question in economic and social relationships. In labor contracts, a worker's decision about his effort is often not contractible and his employer may need to provide him with incentives to work. A manager may have an inclination not to maximize the firm's profits but to use some of the company resources to obtain private benefits. An insurance company may fear that insured people are less cautious with the insured property than when they face the whole cost of the damage. These incentive problems appear because one party in the relationship (the "agent") takes a decision that affects another party (the "principal"), and they are usually referred to as "moral hazard" or "agency" problems. 1 The theory of incentives studies the best contract (for addressing moral hazard) for a given relationship, where this relationship is considered in isolation from any other. That is, it looks at a given principal and a given agent (or possibly several principals and/or agents) that intend to establish a relationship, and characterizes the optimal contract that the principal will propose, among the ones that the agent is ready to accept and considering that the agent will exert the effort that is best for him given the contract.
Some principal-agent relationships are indeed isolated partnerships. This is the case, for example, for the regulatory relationship between a government and an established monopoly. Here we can see that the government cannot look for an alternative firm to provide the service and the firm cannot look for an alternative government. However, most relationships take place in "markets": a principal is typically not forced to hire a particular agent but she can possibly partner with any agent present in the market, and similarly for the agents. For example, an investor is not compelled to invest in a certain start-up and a start-up is not forced to receive financing from a specific investor; any investor and any start-up will look for who to partner and sign a contract with. This means that not only is the contract in each relationship endogenous but so is the identity of the partners that establish relationships.
Simultaneously to the development of the theory of incentives, Gale and Shapley (1962) and Shapley and Shubik (1972) pioneered the development of the two-sided "matching theory." Two-sided matching theory studies markets where players belong, from the outset, to one of two disjoint sets. The questions this theory addresses refer to the partnerships that are formed at the equilibrium and, in some models, the terms of the transfers between partners. One relevant advantage of matching theory is that it can successfully accommodate situations with heterogeneous players in either or both sides of the market. Some recent papers 2 emphasize that the theory of incentives and matching theory can complement each other. In particular, matching theory can be used as a tool to study incentive contracts in a general equilibrium scenario that allows the consideration of discrete as well as continuous sets of heterogeneous principals and heterogeneous agents.
The analysis of optimal incentive contracts within a general equilibrium framework allows new questions to be addressed such as the equilibrium payoffs of principals and also the endogenous agents' utility as a function of the characteristics of all the market participants; and the joint characteristics of the principal-agent pairs that decide to partner. Moreover, considering each principal-agent relationship not in isolation but as part of a market may strongly influence, and even reverse, the results on the effects of the characteristics of the principal and the agent on the optimal incentive contract. Indeed, the comparative static exercises performed in a principal-agent model to understand the effect of, say, the improvement of an agent's characteristic on the terms of the contract do not take into account that such an improvement may lead the agent to be matched, at equilibrium, to a different principal. Hence, the optimal contract is not only affected by the change in the agent's characteristic but also by the difference between the characteristics of the new versus the old principal.
Moreover, from a matching point of view, the existence of moral hazard problems may have a significant effect on the type of matching between principals and agents that we may observe at equilibrium, compared to the matching that would happen if incentive problems were absent. Under moral hazard, the gains that the participants get when they match are different, and that affects the equilibrium outcome.
In this paper, we present several models that address incentive problems in general equilibrium environments. As will be clear during the discussion, some models are simple versions from previous papers by several authors. Other models are original. They provide meaningful economic intuitions in relevant economic situations. Moreover, they allow us to foresee how to use incentive and matching theory together to address other questions.

The assignment market
The assignment market (Shapley and Shubik 1972) is a representation of a two-sided market where each player can participate at most in one transaction. There is a (finite) set of n heterogeneous principals, P = {1, 2, ...., n} and a (finite) set of m heterogeneous agents, A = {1, 2, ...., m}. A principal might be an employer, a lender, or a landowner. An agent might a worker, a borrower, or a tenant. Principals are denoted by i, i , etc., whereas agents are denoted by j, j , etc. In the assignment game, each principal can hire at most one agent, and each agent can work for at most one principal. 3 In addition, in the assignment game the attributes or characteristics of the participants of both sides are public information (there are no frictions).
If principal i does not hire any agent in A, she obtains profit o i , which we normalize to zero: o i = 0. If agent j does not work for any principal in P, then he obtains an outside utility of U o j = U o . Thus, o i and U o j represent the value for principal i and agent j of staying unmatched. On the other hand, if principal i and agent j match, then they produce a joint surplus of S i j . Given the heterogeneity of principals and agents, the surplus S i j typically depends on the identity and the attributes of both the principal and the agent. An important assumption is that principal i and agent j can share S i j in any way they wish, that is, utility among them is fully transferable. Thus, any profile of payoffs i , U j such that i + U j ≤ S i j is feasible for the pair {i, j}. 4 The formal definition of a matching in the market {P, A, S, U o } is: Definition 1 A feasible matching is a function μ from P ∪ A to P ∪ A such that: We say that principal i (resp. agent j) is matched if μ(i) ∈ A (resp. μ( j) ∈ P). If μ(i) = i or μ( j) = j, then we say that principal i or agent j are unmatched.
A feasible matching μ is optimal if it maximizes the gain of the whole set of players. If we denote S j j ≡ U o the utility obtained by an unmatched agent, we can then define: Definition 2 A feasible matching μ is optimal if j∈A S jμ( j) ≥ j∈A S jμ ( j) for any feasible matching μ .
In this market, an outcome consists of a feasible matching and a vector of feasible payoffs (that is, profits and utilities) for principals and agents. This vector describes how the joint surplus of any matched pair is shared among the partners.
Definition 3 A feasible outcome (μ; , U ) consists of a feasible matching μ, a vector of profit levels = ( i ) i∈P , and a vector of utilities U = U j j∈A such that: In the market {P, A, S, U o }, the matching between principals and agents as well as the sharing of the surplus of any partnership are endogenous. Any principal or any agent can look for an alternative partner and can sign a different contract. Therefore, we will focus on those outcomes that are stable. Moreover, in the assignment game, stability, pairwise stability, and competitive equilibrium are equivalent concepts. In particular, it is easy to define competitive equilibria in this market and show that an outcome is stable (or pairwise stable) if and only if it is a competitive equilibrium (Shapley and Shubik 1972). In this paper, we will refer to stable outcomes as competitive equilibrium outcomes, or simply as equilibrium outcomes.
An equilibrium outcome is individually rational. Moreover, if the outcome is a competitive equilibrium, it is not possible for a principal and an agent (who are possibly not matched under that outcome) to form a partnership and share the surplus in such a way that they are both better off under the new partnership than under the previous outcome. We could say that an equilibrium outcome is "divorce-proof." Shapley and Shubik (1972) prove that equilibrium outcomes always exist in the assignment game. They also show the following results on the set of equilibrium outcomes, which will be useful in the following sections.
Proposition 1 (a) If (μ; , U ) is an equilibrium outcome then μ is an optimal matching. (b) Let (μ; , U ) be an equilibrium outcome and μ an optimal matching. Then μ ; , U is also an equilibrium outcome.
Proposition 1 allows the study of the characteristics of the equilibrium matchings by analyzing the properties that make a matching optimal. It also states that principals or agents have the same set of equilibrium payoffs independently of the equilibrium matching.
Moreover, in the set of equilibrium payoffs, there is a polarization of interests between the two sides of the market, that is, if principals are better off in some equilibrium outcome than in another equilibrium outcome, then agents are better off in the second than in the first outcome. In fact, the set of equilibrium payoffs is endowed with a complete lattice structure under each partial order, where one is the dual of the other. In particular, there exist one and only one maximal element and one and only one minimal element in each lattice. Due to the polarization of interests between principals and agents, the best outcome for the principals is the worst outcome for the agents, and vice versa. Formally, Proposition 2 In the set of equilibrium outcomes, there exist a unique principaloptimal payoff + , U − and a unique agent-optimal payoff − , U + . Then, for any equilibrium outcome (μ; , U ), In Sects. 4-6, we study equilibrium outcomes in several principal-agent markets. In any such market, when principal i and agent j establish a partnership (i.e., when principal i hires agent j) the surplus of the relationship S i j will be the result of the contract signed by the partners. To better understand the analysis developed in the next sections, it is useful to make two remarks.
First, we use the assignment game as a tool to analyze the principal-agent markets. To be able to apply the results obtained for the assignment game, the surplus must be transferable inside a partnership. For this reason, we are going to assume particular functions for the preferences of principals and agents: the principals will be risk neutral and the agents will have constant absolute risk-averse (CARA) preferences. We will discuss principal-agent markets where the surplus is not fully transferable in Sect. 7.
Second, all the contracts in an equilibrium outcome are Pareto optimal. The optimality of the contracts is due to the possibility that the same pair can block the initial outcome with a different contract. Therefore, before we move to the analysis of principal-agent markets, we address the characteristics of the Pareto-optimal contracts in any principal-agent relationship in the next section. We will recall the results under symmetric information among the participants as well as the optimal contracts in situations with moral hazard for the classic agency model.

Pareto-optimal contracts in a principal-agent relationship
In this section, we consider an isolated partnership. Thus, we drop the subscript i and j for principals and agents. We can think of any such relationship as a principal hiring an agent to perform a task, which we refer to as effort, e ∈ E, in exchange for a wage, w. The final output of the relationship, x, depends on the effort e that the agent devotes to the task and a random variable for which both participants have the same prior distribution.
We assume that the principal is risk neutral, whereas the agent has CARA preferences (an exponential utility). Formally, an agent that receives salary w and exerts effort e obtains a utility of: where r ≥ 0 is the coefficient of absolute risk aversion. Additionally, we assume that the cost of effort v(e) takes a quadratic form: v(e) = 1 2 ve 2 .
Concerning the output x, we assume that it is linear in the effort e and a random variable ε: where α ≥ 0, σ > 0, and ∼ N (0, 1). Thus, the expected output of the production process is α + e.
Finally, we assume that the contract is linear in the realized output. That is, we restrict attention to linear wage schemes of the form w = F + sx, where F is a fixed payment and s is the share of the output that goes to the agent. 5 It is convenient to express the utility of the agent as a function of the contract (F, s) and the effort e in terms of the agent's certain equivalent income: 6 The Pareto-optimal contracts are the result of the principal maximizing her profits subject to the agent obtaining a certain utility level (equivalently, we can maximize the utility of the agent subject to the principal attaining a certain level of profit). The utility obtained by the agent in the market will be endogenous, but in this section we are going to denote it by U . We note that in general U will be different from U o .

Pareto-optimal contracts under symmetric information
If effort is contractible, the optimal contract (F, s, e) is the solution to Max (F,s,e) where we have taken into account that the principal maximizes expected profit. The constraint PC is the agent's participation constraint, which ensures that he obtains at least U . It is easy to see that PC is binding and it determines the fixed part of the sharing rule F. Using the PC, the program simplifies to: Max (s,e) α + e − 1 2 rs 2 σ 2 − 1 2 ve 2 .
The principal's profit is decreasing in s, which gives the first-best sharing rule under symmetric information s SI = 0. Moreover, the first-order condition (FOC) with respect to e gives e SI = 1 v . Therefore, the optimal contract under symmetric information is: For any such contract, the joint surplus is which does not depend on U . An increase in one unit in the level of utility of the agent U translates into a decrease of exactly one unit in the profit of the principal . Therefore, the utility is fully transferable.

Pareto-optimal contracts under moral hazard
If effort is not contractible, then the agent will choose the effort that maximizes his utility once the contract (F, s) is signed. His incentive-compatibility constraint (ICC) is the solution to i.e., the ICC gives The principal maximizes the same program as before, but taking into account the ICC. The binding PC determines the fixed fee, F. Using this expression for F, we conclude that the principal solves: The FOC of this program leads to s MH = 1 1+r vσ 2 ∈ (0, 1] . Notice that s MH summarizes the standard conclusions of moral hazard problems: the power of the incentives is decreasing in the cost of the effort v and in the variance of the outcome σ 2 (as long as r > 0). In addition, it is decreasing in the agent's risk aversion (measured by r ). Since a higher s MH translates into a higher expected output through the ICC, the previous expression reflects the trade-off between efficiency (optimal risk-sharing would require s MH = s SI = 0) and incentives. Therefore, the optimal contract under moral hazard is and leads to the effort The joint surplus under moral hazard is, after some easy calculations, Again, the surplus is independent of U : the principal can give or take away utility directly through the fixed part of the contract F.

Contracts in a principal-agent market
We now go back to consider a principal-agent market. The set of heterogeneous, risk-neutral principals is P = {1, 2, ...., n} and the set of heterogeneous agents, with a CARA utility function, is A = {1, 2, ...., m}. Each participant knows the characteristics of all the principals and agents. We address questions such as the nature of the endogenous matching between principals and agents (who is hired by whom), the effect of the moral hazard on the nature of the matching, and the endogenous level of profit and utility that the participants obtain.
The participants can be heterogeneous in various characteristics. First, agents can differ in their degree of risk aversion and in their cost of exerting effort, so agent j's utility function is Second, both principals and agents can have a heterogeneous influence on the output. In particular, depending on the identity of the agent and/or the principal, the output can be more or less volatile. Thus, the output that is obtained in a partnership between principal i and agent j when the agent exerts effort e is: where α ≥ 0, σ i j > 0, and ∼ N (0, 1). The total surplus obtained in a partnership depends on the principal's and the agent's characteristics. Suppose that we consider characteristics c i and c j , and let us denote the total surplus by S c i , c j . Then, we say that the matching is positive assortative (PAM) if a principal with a higher value of c i is matched with an agent with a higher value of c j : if c i ≥ c i then c μ(i) ≥ c μ(i ) . Similarly, we have a negative assortative matching (NAM) if c i ≥ c i implies c μ(i) ≤ c μ(i ) . For instance, imagine that c i and c j are characteristics that improve the total surplus attained in a partnership: S c i , c j ≥ S c i , c j if and only if c i ≥ c i and S c i , c j ≥ S c i , c j if and only if c j ≥ c j . Then, the matching is PAM if "good" principals are matched with "good" agents and "bad" principals are matched with "bad" agents. On the other hand, if the matching is NAM, "good" principals are matched with "bad" agents and "bad" principals are matched with "good" agents.
From the analysis of Sect. 2, we know that the equilibrium matching is PAM if and only if PAM is an optimal matching. Moreover, since Becker (1973), we also know that in markets with a transferable utility and where agents of each side of the market differ in a one-dimensional characteristic, a sufficient condition for PAM to be an optimal matching is that there is type-type complementarity in the production of surplus. Similarly, a sufficient condition for NAM is type-type substitutability. If the surplus function is differentiable (as is the case in our model), then a sufficient condition for PAM (NAM) is that the cross-partial derivative of the surplus function with respect to the characteristic of the principal and the characteristic of the agent is positive (negative).
The first subsection will discuss the characteristics of the equilibrium outcomes under symmetric information in several scenarios concerning the heterogeneity of principals and agents. All the examples correspond to scenarios where principals and agents are heterogeneous with respect to characteristics that we can consider "vertical characteristics," in the sense that we can rank, say, the agents (resp. the principals) from best to worst. For instance, the cost of exerting effort is a vertical characteristic: having a lower cost cannot be bad. 7 The next subsection will analyze the same scenarios when moral hazard is present in each of the partnerships.

A principal-agent market under symmetric information
We present three examples where under symmetric information any matching can be an equilibrium because the cross-partial derivative of the surplus with respect to the characteristics of the principal and agent is zero in the three scenarios, while other characteristics of the equilibrium may be different. This will facilitate the comparison with the results in the same environments when moral hazard is present.

Heterogeneous principals in the variance of their project and heterogeneous agents in their degree of risk aversion
Consider a situation where principals differ in the variance of their project, whereas agents differ in their degree of risk aversion. Each side of the market is similar in any other respect. Formally, v j = v and σ 2 i j = σ 2 i for all i ∈ P and j ∈ A. Then, thus, any matching is an equilibrium matching. In this scenario, any principal fully ensures the agent she hires, so principals do not care about the risk aversion of the agent they are matched with; hence, also the agents do not care about the variance of the principals' project. 8 In particular, at equilibrium, all the matched principals obtain the same level of profits and all the matched agents obtain the same utility level. Indeed, in an outcome where U j > U j , the principal μ( j) and the agent j could deviate because μ( j) and j together can produce more than the sum of the surplus they obtain at the outcome. And a similar reasoning holds if i > i for some principals i and i .

Heterogeneous principals in the variance of their project and heterogeneous agents in their ability
Imagine that principals differ in the variance of their project and agents are heterogeneous in terms of their cost of effort: r j = r for all j ∈ A but v j can differ among agents. The parameter v j can be thought of as the inverse of the ability of the agent. Then, Also in this case, the cross-partial derivative of S SI with respect to σ 2 i and v j is zero, and any matching is optimal.
As in Sect. 4.1.1, the variance of the principal's project does not matter in the expression of S SI σ 2 i , v j . Hence, all matched principals obtain the same profit level at equilibrium. However, this is not true for the agents. As is intuitive, a matched agent with higher ability (that is, a lower v j ) enables obtainment of higher surplus, hence, at equilibrium he obtains a higher utility level than an agent with lower ability. To check this property, consider an outcome where v j > v j but U j ≥ U j . Then, the principal μ( j) and the agent j could deviate because μ( j)

Heterogeneity in the variance that principals and agents induce in the project
We now consider a situation where both the principal and the agent influence the volatility of the project. We can think of a market where principals may have more or less risky projects, and agents may be more or less precise in their job. Formally, r j = r and v j = v for all i ∈ P and j ∈ A. Moreover, assume for simplicity σ 2 i j = σ 2 i + σ 2 j for all i ∈ P and j ∈ A. Then again, the cross-partial derivative of the total surplus with respect to σ 2 i and v j is zero, and any matching is efficient (Li et al. 2013). 9

A principal-agent market under moral hazard
In this subsection, we analyze the consequences of the moral hazard problem by studying the same markets as above but when the effort is not verifiable.

Heterogeneous principals in the variance of their project and heterogeneous agents in their degree of risk aversion
When principals are heterogeneous in the risk of the project, σ 2 i j = σ 2 i , and agents are heterogeneous in their degree of risk aversion, r j , the joint surplus when the partnerships are subject to moral hazard is: Now, the volatility of the project and the agent's degree of risk aversion have a negative impact on the joint surplus. A "good" principal is one with a low-volatility project, and a "good" agent has a low degree of risk aversion. Moreover: The main implication is (see , Wright 2004;Serfes 2005Serfes , 2008.

Proposition 3
Under moral hazard, if principals are heterogeneous in the risk of the project, σ 2 i , and agents are heterogeneous in their degree of risk aversion, r j , then: Proposition 3 shows that the moral hazard problem not only distorts the optimal contract inside a partnership but it can also change the nature of the equilibrium matching. Under symmetric information (Sect. 4.1.1), any matching can be part of an equilibrium outcome. However, only PAM can arise as an equilibrium matching if r j σ 2 i ≥ 1/v for all i ∈ P and j ∈ A, and only NAM if r j σ 2 i ≤ 1/v for all i ∈ P and j ∈ A.
PAM emerges as an equilibrium matching if the degree of volatility and risk aversion in the market is high. On the other hand, in markets where the volatility and/or the degree of risk aversion are very low, the equilibrium matching is NAM. Of course, many markets do not satisfy either of the two sufficient conditions highlighted in Proposition 3. In those markets, we can have equilibrium matchings that are neither PAM nor NAM. Moreover, the equilibrium matching depends not only on the degree of the volatility of the projects and the risk aversion of the agents; it is also a function of the distribution of these characteristics on the population of the participants.
We now discuss how considering that principal-agent relationships are part of a market may modify some of the implications of the comparative statics exercises that are often conducted in principal-agent models. 10 One robust implication from this model is that there exists a negative relation between risk and incentives: the more volatile the project, and the more risk-averse the agent, the lower the power of the incentives in a moral hazard situation. In particular, in the CARA model that we analyze, the share s MH (σ 2 , r ) = 1 1+r vσ 2 is decreasing in both σ 2 and r .
Let us now take into account that there is an endogenous matching between principals and agents (see Serfes 2005Serfes , 2008 for a more extensive discussion). Denote r j (σ 2 i ) = r μ(i) the endogenous relationship in the matching between the volatility of the project and the agent's level of risk aversion. The power of incentives as a function of the volatility of the project is: If the matching is PAM, then r j (σ 2 i ) > 0; hence, r j (σ 2 i )vσ 2 i increases with σ 2 i , which implies that the incentives have less power as σ 2 i increases. This result is similar to the comparative statics result in a model where the principal-agent match is given. However, if the matching is NAM, then r j (σ 2 i ) < 0. Therefore, r j (σ 2 i )vσ 2 i can be increasing, decreasing, or it may have any other shape, depending on the distribution of the attributes of the population of principals and agents.
Finally, it is also interesting to discuss the changes in the equilibrium profit and utility level as a function of the characteristics. Remember that under symmetric information (Sect. 4.1.1) all matched principals obtain the same profit and all the matched agents get the same utility level. However, this is no longer true under moral hazard. The higher the variance of her project, the lower the profit that a principal obtains. Similarly, the higher the agent's risk aversion, the lower his equilibrium utility level. 11 The fact that the "bargaining power" of principals and agents is endogenous in the market has other important implications for the empirical analysis. For instance, we have seen that in a PAM, an agent's bonus is decreasing in his degree of risk aversion. Following the discussion in Serfes (2008), in an isolated principal-agent relationship where the principals have the bargaining power, bonuses and fixed salaries should be negatively correlated. Hence, a lower bonus should imply a higher fixed salary. However, in the equilibrium in a market, higher risk aversion also implies a lower level of utility and the negative correlation between fixed and variable payment may no longer hold.

Heterogeneous principals in the variance of their project and heterogeneous agents in their ability
The agents' cost parameter v plays a role similar to the agents' degree of risk aversion r in the optimal contract. However, the analysis when agents are heterogeneous in terms 11 In an environment with a continuous of principals and agents, of ability (in our model, in terms of their cost parameter) is simpler. When r j = r and σ 2 i j = σ 2 i for all i ∈ P and j ∈ A, then which cross-partial derivative is positive. Therefore (see Li and Ueda 2009): Proposition 4 Under moral hazard, if principals are heterogeneous in the risk of the project, σ 2 i , and agents are heterogeneous in their cost parameter, v j , then the equilibrium matching is PAM.
Proposition 4 states that we should expect more able agents (those with lower costs) matched with firms whose projects have lower variance. Li and Ueda (2009) use the proposition to provide an explanation for the fact that safer firms receive funding from more reputable venture capitalists (see also Sørensen 2006), a conclusion that cannot be derived in a model where moral hazard is not present.
In this model, we illustrate how to study the sensitivity of a principal's (resp. an agent's) payoff to her (resp. his) own characteristic. This exercise is easier in a model where the set of principals and the set of agents are continuous because, in contrast to the discrete assignment game, the scheme of equilibrium payoffs is unique. 12 Moreover, to discuss the sensitivity in terms of a "positive" characteristic: denote c i and c j the characteristic of principal i and agent j , respectively, and suppose that σ 2 i = σ 2 − c i and v j = v − c j . Thus, the higher the parameter c i or c j , the better the principal or the agent.
As we mentioned in Sect. 4.1.2, a principal's profit is independent of her type under symmetric information, that is, However, an agent with higher ability obtains a higher level of utility: 13 . 12 We could also use the discrete assignment game and focus in one of the two extremes of the complete lattice of the set of equilibrium payoffs. Demange (1982), Leonard (1983), or Lemma 8.15 in Roth and Sotomayor (1990) show how to compute the precise levels of principals' profits and agents' utilities in the principal-optimal payoff and in the agent-optimal payoff. 13 We can compute the change in the utility level of the agent as a function of v as follows. Consider agent j and agent j such that v j = v j +δ. Denote i = μ( j ). In an equilibrium, principal i and agent j do not have both sides of the equation by δ and taking the limit when δ goes to zero, we obtain Similarly, under moral hazard, we obtain: Therefore, and, in this model, while the principal's characteristic is irrelevant under symmetric information, it has a strong influence on the principal's profit under moral hazard. On the other hand, the (positive) effect of the characteristic in agent's utility is stronger under symmetric than under moral hazard. This illustrates that the asymmetry of information is often detrimental not only to the principal's profit but also to the agent's equilibrium utility level.

Heterogeneity in the variance that principals and agents induce in the project
When the heterogeneity among principals and among agents derive from the influence that both have on the volatility of the project (and assuming σ 2 i j = σ 2 i + σ 2 j ), then Therefore, the cross-partial derivative is positive and Proposition 5 follows.
Proposition 5 Under moral hazard, if both principals and agents are heterogeneous in their influence on the volatility of the project, σ 2 i j = σ 2 i + σ 2 j , then the equilibrium matching is PAM.
In this market, the principals with relatively safe projects end up hiring agents who are relatively precise in their job, whereas risky projects are carried out by agents who induce further volatility in the output. Also in this model, moral hazard considerations But we can take the other sense of the inequality as well, hence, We can use a similar procedure for the following expressions.
have a strong influence on the nature of the matching. The effect of the project's volatility on the total surplus is only indirect, through the bonus s MH σ 2 i , σ 2 j that the agent receives in the optimal contract. A higher σ 2 i , that is, a riskier project, weakens the incentives that the agent receives. This happens because the cost of the bonus (versus paying a fixed fee) increases with the volatility of the output. More importantly for the nature of the matching, given that ∂ 2 s MH ∂σ 2 i ∂σ 2 j > 0, the effect is less negative for agents with high σ j , that is, for less precise agents. Therefore, efficiency (or optimality) requires that risky projects are carried out by less precise agents. 14 5 Beyond two-sided one-to-one partnerships The environments discussed in the previous section involve two-party partnerships and use the two-sided one-to-one assignment game as a tool. The analysis of more general environments where more than two parties can form partnerships can be complex and the existence of equilibrium or stable outcomes may be problematic. 15 However, some of the tools that we have used, and other tools provided in the literature, can be useful for particular environments. In this section, we present two examples.

A simple owner-principal-agent market
Suppose an environment where production requires the partnership between three parties: an owner (a landlord who owns the land, an owner of the permit to have a business, or a shareholder who provides the financial resources), a principal (who brings or run a project), and an agent (who works on the project). Thus, this market corresponds to a "three-sided" (instead of two-sided) one-to-one game. To make the model very simple, assume all the owners are identical and risk neutral. Moreover, the principals' profit, agents' utility, and production functions are as in Sect. 4. Finally, the number of owners is larger than the number of principals and than the number of agents.
An equilibrium is this simple three-sided market consists of a set of three-party (an owner, a principal, and an agent) partnerships and some isolated players, as well as an individually rational sharing of the surplus in each partnership, such that it is not possible for an owner, a principal, and an agent to form a partnership and share the surplus in such a way that they are all better off under the new partnership than under the previous outcome.
14 In quite a different model, Li et al. (2013) also find that moral hazard pushes toward PAM in terms of risk. They study the equilibrium matching between principals and agents who are all risk-averse and heterogeneous in their degree of risk aversion. Moreover, the agents exert unverifiable efforts to increase the mean of the output and to reduce its volatility. 15 For example, Alkan (1988) shows that in the three-sided one-to-one matching market stable outcomes may not exist. Kelso and Crawford (1982) show that a sufficient condition for the existence of equilibrium in a two-sided many-to-one matching model is that agents are gross substitutes from each principal's standpoint. If agents are complementary, then equilibria may fail to exist.
A model with these characteristics is easy to analyze because, at equilibrium, it is necessarily the case that the payoff of all the owners is zero. Indeed, consider an outcome where an owner, say k, obtains positive equilibrium profits. This owner is necessarily matched with a principal (say i) and an agent ( j). But then, some unmatched owner (say k ) could make offers to i and j, form a new partnership, obtain the same total surplus as the team {k, i, j} , and share it so that the three partners, k , i, and j, are better off than before.
Given that the owners are identical and obtain zero profits, they are like "dummies" in this model. In fact: (i) Take any equilibrium (μ; , U ), with = ( i ) i∈P and U = U j j∈A , in the two-sided principal-agent matching market. Consider the following outcome in the three-sided owner-principal-agent market: (a) a partnership {k, i, j} is formed if and only if j = μ(i), where k is any owner; (b) if the partnership {k, i, j} is formed, then the owner obtains zero profits, principal i gets i and agent j gets U j . This is an equilibrium outcome. (ii) And similarly, given an equilibrium in the three-sided market (which involves zero payoff for the owners), the restriction of the partnership and the payoffs to the sets of principals and agents constitutes an equilibrium in the two-sided market.
We note that the previous result holds because the market is particularly simple, not only due to the existence of many identical owners but also because only one of the two "important" partners (the agent) is subject to moral hazard. If both the principal and the agent are subject to moral hazard then the owners can play the role of "residual claimant" in the relationships because they can break the budget-balance constraint, even if there are still many identical owners and they obtain zero benefits at equilibrium. Thus, the existence of owners would improve the efficiency of the production by the principal and the agent and the previous equivalence would no longer hold. 16 But the approach that we have proposed can still be useful for analyzing such markets.

A market where each principal hires two agents from a single pool
We consider again an environment where there are only two sets of participants: a set of identical risk-neutral principals P and a set of risk-averse agents A with CARA utility function. We now assume that the coefficient of risk aversion r is the same for all the agents and that their disutility of effort is 1 2 ve 2 . However, we study a production function that requires that each principal has to fill up two positions, hence she needs to hire two agents. Thus, this is a two-sided many-to-one matching problem. 17 16 Holmström (1982) highlights the importance of the role of a residual claimant when moral hazard affects more than one participant in a relationship. 17 In our model, each principal hires several (two) agents who are subject to moral hazard. One can also analyze situations where it is the agent (subject to moral hazard) who contracts with several principals. One example of such a situation is found in von Lilienfeld-Toal and Mookherjee (2016), who analyze a credit market. This paper also illustrates that an exogenous shock may have a general equilibrium effect in a market contracts which is absent in an isolated principal-agent relationship.
Each agent makes an effort in the production and the identity of the two agents hired will determine the volatility of the project. That is, the variance is not a characteristic of the principal but of the team of agents. In particular, when a principal hires agents j and k, the output is where e j and e k are the efforts exerted, respectively, by agents j and k, α ≥ 0, σ jk > 0, and ∼ N (0, 1).
Given that the principals are risk neutral and the agents have a CARA utility function, the utility is still transferable among the participants in any partnership. Therefore, the contracts between the principal and agents j and k maximize the total surplus.
Under symmetric information, and similarly to the case when the principal hires only one agent, the variable part of the optimal contract is zero, s SI j σ 2 jk = s SI k σ 2 jk = 0 and the effort requested is e SI j = e SI k = 1 v . Total surplus for a partnership {i, j, k} is If the agents are subject to a (team) moral hazard problem, and they do not cooperate, then the optimal contracts solve (when agents' utility in the market is U j and U k ): where the expression for e j and e k corresponds to the ICC of the agents (the Nash equilibrium in efforts). The optimal contracts involve s MH 1+r vσ jk 2 . 18 Therefore, total surplus under moral hazard for a partnership {i, j, k} is To discuss the characteristics of the equilibrium outcomes both under symmetric information and under moral hazard, first note that at equilibrium all principals necessarily obtain the same profits eq because they are identical. For instance, if there are fewer agents than twice the number of principals, then some principal will certainly remain unmatched at equilibrium and all the principals (matched or unmatched) will obtain eq = 0. In any case, at equilibrium, any surplus beyond eq generated in any partnership goes to the agents. Thus, even though it is the principals who are competing to create the partnerships, the equilibrium characteristics of the matching correspond to the characteristics of the equilibrium in the one-sided one-to-one matching problem among the agents.
In the one-sided one-to-one matching problem, there is a unique set of players (in our case, the set of agents A) and any two agents can form a partnership if they so decide. An outcome corresponds to a matching between agents (which can also be identified by a partition of the set of agents in either pairs of agents or singletons) and a sharing of the surplus obtained by any pair. In the one-sided one-to-one matching model with a finite number of agents, equilibria may not exist. 19 But equilibria always exist if there is a continuum of agents. 20 Thus, for this model and for simplicity, we are going to assume that there is a continuum of agents A and a continuum of principals P. The definitions and properties of the assignment game are easily extended to the continuous framework.
If there is symmetric information in the market, even though the agents may be different in their effect on the variance of the project, the variance is in fact irrelevant because S SI σ 2 jk is constant. Therefore, in terms of the surplus, agents are identical. This implies that any matching (both in the one-sided and in the two-sided matching models) is optimal, hence, any matching is an equilibrium matching. Moreover, all the agents obtain the same level of utility. For instance, each agent obtains a utility of 1 2 α + 1 v if there are more principals than half the number of agents. To study the market equilibrium when both agents are subject to moral hazard, let us assume that each j ∈ A is characterized by a parameter σ 2 j > 0 so that the variance of a team formed by j and k is σ 2 jk = σ 2 j + σ 2 k + γ σ 2 j σ 2 k with γ ∈ R and |γ | not too large. Then, the surplus S MH σ 2 j , σ 2 k depends on the types σ 2 j and σ 2 k working for the principal.
As it happens in the two-sided models, in the one-sided models there is PAM when agents' characteristics are complementary: regardless of the distribution of types, "good" agents partner with "good" agents, and "bad" agents partner with "bad" agents. In fact, if the surplus function is strictly supermodular, then there is segregation among agents: every agent matches with someone identical to themselves. 21 On the other hand, if the surplus function is strictly submodular, then at equilibrium there is NAM among agents. 22 Therefore, taking into account the expression for S MH σ 2 j , σ 2 k , there is segregation if 19 See, e.g., Talman and Yang (2011) for some sufficient conditions for the existence of equilibria. 20 See the results by Kaneko and Wooders (1986) and Gretsky et al. (1992). 21 See, for instance, Kremer (1993). 22 See Legros and Newman (2002) for a careful analysis of sufficient conditions for monotone matching.
In this case, each principal hires at equilibrium two identical agents. It is more efficient that high-variance agents go together and low-variance agents go together, because this matching minimizes the distortion in incentives for the team. This happens when γ is negative, or it is positive but small enough.
Similarly, the surplus is strictly submodular and the equilibrium is NAM if Therefore, if γ > 0 and large, then we should see at equilibrium that a principal who hires an agent with very low variance also hires an agent with very high variance. In this case, hiring two high-variance agents is very costly, because providing incentives is very expensive. Thus, it is better to mix high-and low-variance agents. NAM is also more likely if v is small, because a lower v means a higher efforts in the optimal contracts, which makes dealing with very high variances more expensive and hence less efficient.
Again, the moral hazard problem has important consequences for the type of matching that takes place in the market. And it also affects in a new way the relationship between an agent's level of variance and the power of the incentives he receives in the market. We now discuss this fact in brief.
In an isolated multi-agent moral hazard situation, when the variance of one of the agents increases, the total variance of the team increases and the incentives for both partners decrease. That is, we should observe that the power of the incentives decreases with the variance. However, in the market, taking into account the assignment, one has to be more careful.
To see how incentives change with an agent's volatility, consider a market where (3) holds so that the matching is NAM. Moreover, σ 2 j is distributed according to a uniform distribution in σ 2 , σ 2 . This means that the equilibrium partner μ ( j) of j has an associated variance of σ 2 μ( j) = σ 2 + σ 2 − σ 2 j . The power of incentives given to agent j is . Therefore, Figure 1 shows the power of the incentives as a function of σ 2 j , when σ 2 , σ 2 = [1, 3]. The teams formed by agents with variance more to the center of the interval of individual variance (the team (k, μ(k)) as compared to the team ( j, μ( j))) are those teams with higher total variance, hence they receive fewer incentives. Below the mean, when the variance of an agent increases, each individual will receive lower incentives. This is the same comparative static as in a single principal-agent model. But above the mean, an increase in the variance of the agent will lead to an increase in his incentives (because his partner will have lower individual variance and the team total variance will decrease).

A market with repeated moral hazard
In the previous sections, we have studied several markets where principals and agents interact. One important feature of those markets is that they are static. Interactions between principals and agents only happen once. This is a natural hypothesis given that the assignment game, which constitutes our tool to model markets, is also a static model. However, we can also use the ideas and methodology derived from the assignment game to model some dynamic markets.
In this section, we propose a dynamic model where a set of principals and a set of agents meet every period. The model is in the same spirit as , but the particulars of the model and the objective are different. In that paper, the main objective is to show that the existence of a market strongly influences the principals' choice of short-term (ST) or long-term (LT) contracts when agents have industry-specific abilities and are subject to moral hazard. 23 We consider that agents have industry-and principal-specific characteristics and we analyze the influence of these characteristics on the equilibrium configuration of LT and ST contracts in the industry. Moreover, contrary to , we assume (as in the previous sections in this paper) that agents are risk-averse with a CARA utility function, which implies that LT and ST contracts are equally optimal in an isolated principal-agent relationship. 24 For simplicity, we consider that the agent consumes all his income at the end of the second period, so that we do not study his intertemporal consumption decision. Also for simplicity, we model the sets of principals and agents as continuous, instead of discrete, sets.
We model the economy as an overlapping generation model where at each period t, with t = 1, 2, ..., principals (firms) contract with agents (workers) to develop projects. Principals are infinitely lived, risk-neutral players, and the set of principals is constant for all periods. They are heterogeneous in the potential return R of the technology they own. For a given principal i, the attribute R i is the same across periods and it is distributed in the interval R, R , with R > 0, according to the distribution function G(R). On the other hand, agents live for two periods, and their preferences are represented through a CARA utility function with the same coefficient of risk aversion r . Both principals and agents discount the future according to the discount factor δ ∈ (0, 1).
At any period t, a generation of agents is born. Thus, in period t the market is composed of the set of principals, the set of agents that enter the market during this period and the set of older agents that entered the market in period t − 1. In period 1, there is a set of agents who are already old.
To run its project, a principal must hire a non-trained (junior) agent and a trained (senior) agent. To become trained, that is, senior, an agent must have worked in this market in the first period of his life. We assume that the measure of the set of agents born in any period is larger than the measure of the set of principals, so there are more junior agents than non-trained positions to fill in the market.
The output x for principal i from the project follows the production function: where σ > 0 and ∼ N (0, 1). Parameter p refers to the characteristic of the senior agent, and e to his effort. The senior's cost of effort is v(e) = 1 2 ve 2 . We assume that the non-contractible effort of the senior agent is crucial for determining the output, whereas the junior agent performs a routine job whose cost is normalized to zero.
The senior agent's productivity, p, summarizes his ability/productivity. We assume that this productivity takes the form p = p I + θ , where p I is the senior industryspecific ability (the same for all principals) and θ is the senior principal-specific ability. 25 Concerning the principal-specific ability, we assume that θ = 0 when the senior agent works for a principal different that when junior, and θ = > 0 when he works for the same principal than when junior. As for the industry-specific ability, all juniors are identical ex ante but during their work as juniors, their industry-specific talent becomes public. We assume that there is a proportion q of high-ability agents that have p I = p H and a proportion (1 − q) of low-productivity agents with p I = p L .
Industry-specific ability is important, so that p H − p L > . Then, they are two types of agents but four possible levels of productivity: p ∈ { p H , p H + , p L , p L + }.
A senior agent enters a relationship only if his expected utility is at least equal to U o . Similarly, a junior agent accepts a contract only if his expected intertemporal utility is at least U o + δU o . For simplicity, we assume that R is high enough and all principals in R, R are active in the market; hence, we disregard the principals' participation constraint.
Concerning the salaries, a junior agent working for a principal receives a fixed wage B. As above, the principal offers a linear contract w = F + sx to the senior agent, with s ∈ [0, 1] . Thus, if he is hired by principal i, a senior agent with ability p selects the effort In any period t, the expected profit of a principal i that runs her project with a junior agent, to whom she pays the salary B, and a senior agent of ability p, who is paid according to the payment scheme Principals and agents can sign either ST or LT contracts. An ST contract between a principal and a junior agent consists of a salary B. An ST contract between a principal and a senior agent is an incentive scheme (F, s) that may depend on the potential of the principal's project R and the agent's productivity p. An LT contract between a principal and a junior agent in period t specifies the salary that the agent will receive during this period and the incentive scheme that will govern the relationship in period t + 1, which will be a function of the revealed ability of the agent. That is, an LT contract is a vector (B, F H , s H , F L , s L ) that implies a commitment by the principal to retain the agent as a senior and a commitment by the agent to work for the same principal in period t + 1.
We focus on stationary equilibria, that is, on equilibria where firms offer the same contracts every period. This allows us to do the analysis, taking into account the expected profits that principals make in one (in any) period. The only small arrangement we have to make is that we need to associate to the junior agent a cost of 1 δ B rather than B , because any possible deviation of the type of contract by a principal will have consequences in the next period. 26 We denote the one-period profit E π . A principal has an incentive to switch from contract C to contract C if and only if E π(C) < E π(C ). As was the case in the static models that we presented in the previous sections, all the equilibrium contracts must be Pareto-optimal. Thus, before describing more characteristics of the equilibrium, we state the Pareto-optimal LT and ST contracts.

Pareto-optimal long-term contracts
Given that there are more junior agents than principals, and junior agents are ex ante identical, any principal can secure the services of a junior agent if he receives a total (two-period) discounted payment of (1 + δ) U o . Therefore, principal i looks for the contract (B, F H , s H , F L , s L ) that satisfies the agent's PC (with equality at the optimum): and she solves the following problem: The previous program takes into account that an agent hired under an LT contract always acquires the principal-specific ability; hence, his productivity is either p H + or p L + . Proposition 6 states the characteristics of the candidate LT contract for principal i. 27

Proposition 6 If in equilibrium principal i offers an LT contract, then:
i ( p L + ) 2 +r vσ 2 , and the vector of fixed payments (B, F H , F L ) satisfies (PC L T ).
The principal's one-period profit under the optimal LT contract is: It is worth noticing that the profit function E π LT (R i ) is continuously differentiable and increasing in R i .

Pareto-optimal short-term contracts
All principals signing ST contracts hire similar junior agents, as they are indistinguishable ex ante. With respect to senior agents, principals can decide to hire high-ability or low-ability agents (and a senior with principal-specific skills or not). If a senior agent is hired by the principal for whom he worked last period, he has a higher productivity than if hired by another principal. However, all seniors have the same value for the other principals in the market. As a consequence, all high-ability seniors have the same "equilibrium value" U H in the market and all low-ability seniors can obtain the same U L . 28 The equilibrium salary B that the junior agent will receive satisfies: where the equality is due to the abundance of junior agents. We now compute the Pareto-optimal contract offered by principal R i to a senior agent with industry-specific ability I , for I = H , L, who must receive U I . Denote p I the agent's productivity: p I = p I + if the agent worked last period as a junior for the same principal and p I = p I otherwise. Then, the principal solves the following program:

Proposition 7 a) If principal R i offers ST contracts and hires senior agents then:
(a) If the productivity of the agent is p I , the contract is s I = (b) If the productivity of the agent is p I , the effort is 28 The market for seniors is an assignment game with a continuum of equilibria in terms of payoffs. If, for instance, we denote U H the utility that a high-ability senior obtains in equilibrium when he works for a principal for whom he has no principal-specific ability, then he could obtain any U ∈ [U H , U H + ] in equilibrium if he works as a senior for the same principal as a junior. Thus, we focus at the equilibrium that gives the principal-optimal payoff (see Proposition 2). If we would consider equilibria where the highability seniors obtain more than U H , then this increase in utility when senior would lead to a decrease in the fixed payment to all junior agents and, in expectation, a junior agent would obtain the same utility in both equilibria. The same comments hold for equilibria where the low-ability agents would obtain more than at the principal-optimal payoff.
(c) The expected principal's one-period profit when she hires a high-ability or a low-ability senior agent, also taking into account the cost of the junior agent, is As it happens for the optimal LT contracts, the profit functions E π ST H (R i , B, U H ) and E π ST L (R i , B, U L ) are continuously differentiable and increasing in R i .

Equilibria
We now look for the equilibrium outcomes. We focus on equilibria where the lowability senior agents obtain U o , that is, U L = U o . For the same reasons discussed in the previous subsection, this simplification does not have consequences for the total agents' expected utility and for the form of the equilibrium contract. In equilibrium, the set of principals is partitioned into a maximum of three subsets: the set of principals that offer LT contracts, the set of principals that offer ST contracts to juniors and to high-ability seniors, and the set of principals that offer ST contracts to juniors and to low-ability seniors. We explore equilibria where ST contracts may appear. 29 In equilibrium, high-ability agents should be more expensive than low-ability agents, that is, U H > U L = U o because every principal makes a higher profit with a high-than with a low-ability senior agent, and the number of high-ability senior agents is lower than the number of principals. Also, the willingness to pay for a high-instead of a low-ability senior increases with the attribute R of the principal. Therefore, if there are ST contracts, principals with a high R will hire high-ability seniors, whereas principals with a low R will hire low-ability senior agents. Finally, it is intuitive that if there is an equilibrium where LT and ST contracts coexist, the principals using LT contracts should have an attribute R that is not too high (so that it is not worthwhile for them to pay as much as U H every period) and not too low (so that they do not hire low-ability agents every period).
Thus, we study the existence of equilibria where there are two thresholds R L and R H with R < R L < R H < R, such that principal i signs ST contracts with lowability seniors if R i ∈ R, R L , LT contracts if R i ∈ R L , R H , and ST contracts with high-ability seniors if R i ∈ R H , R . At equilibrium, low-skilled agents obtain U L = U o and junior agents in ST contracts get (1 + δ) U o in total, that is, equation (4) holds, which implies B = U o − qδ (U H − U o ). Moreover, the equilibria (that is, the parameters U H , R H , and R L ) must satisfy the following three properties: (1) There are as many principals with R i in R, R L as in R H , R , that is, (2) If R i = R L , then principal i is indifferent between using ST contracts hiring low-ability seniors and using LT contracts, that is, (3) If R i = R H , then principal i is indifferent between using LT contracts and using ST contracts hiring high-ability seniors: Proposition 8 shows that an equilibrium with the previous characteristics exists if and only if is low enough. In particular, needs to be lower than the unique threshold o ∈ (0, p H − p L ) implicitly defined by Eq. (8): To illustrate Proposition 8, consider the situation where R is uniformly distributed over R, R = [2, 6] , vr σ 2 = 1, p H = 3 6 , p L = 1 6 , and ∈ 0, 2 6 . In this situation, o = 0.282. Figure 2 summarizes the equilibrium choice between ST and LT contracts in the space (R, ).
As stated in Proposition 8, only LT contracts are signed at equilibrium if the principal-specific ability that a junior agent learns when working for a principal is very large, ≥ o = 0.282. In this case, even for the principal with the most profitable project R = 6 it is not worthwhile using ST contracts to always catch a high-productivity (in terms of industry-specific ability) agent. She would prefer to sign an LT contract with junior agents and benefit from their acquired principal-specific ability. On the other hand, if < o , then there are three groups of principals. Principals with a high R choose ST contracts to make sure that they always hire high-productivity agents. Some of these high-productivity agents also have a principal-specific ability because they were hired by the same principal when junior, whereas others were working for other principals. They all receive a high salary at equilibrium. At the other extreme, principals with a low R choose ST contracts because junior agents are ready to accept low salaries if hired under these types of contracts. They hope to have high productivity and access a high salary when senior. For the principals with intermediate values of R, the principal-specific ability is important enough so that they prefer to always keep the same agents for both periods. The set of principals that prefer LT contracts at equilibrium increases with the importance of the principal-specific ability, so it is larger as increases.
In our model, the junior's ability is unknown to everyone. Hermalin (2002) studies a competitive labor market where workers initially have private information about their ability while this ability becomes public when they become seniors. High-ability workers value the option to entertain outside wage offers once their ability becomes known to the market. Then, offering ST contracts allows the screening of high-ability types from low-ability ones (who prefer LT contracts).
That the ability of a senior agent is public information is another important hypothesis in the model. If the current principal has an informational advantage over the senior's ability then the other principals will attempt to infer the worker's quality by observing the principal's job assignment or promotion decisions (see, e.g., Waldman 1984).
Finally, we assume that the agent can commit to not leaving the firm. If the contract cannot include buyout clauses (to be paid by the principal who wishes to hire the senior worker), penalties in the case of breaking the contract (that the worker would have to pay), or non-compete clauses (forbidding working for another firm in the market) then an agent may not be able to commit to staying in the firm that trained him as a junior (see, e.g., Mukherjee and Vasconcelos 2018).

Conclusion and extensions
In this paper, we analyze the optimal incentive scheme in principal-agent relationships in several market situations. We use the assignment game as a tool to embed the relationships in a general equilibrium framework. We first highlighted the importance of considering principal-agent relationships not as isolated partnerships but as part of a market. When not only the contract but also the identity of the partners are endogenous, some of the conclusions that one obtains in classic principal-agent theory may be reversed. Second, we have shown that the existence of moral hazard may alter the characteristics of the equilibrium matching in markets, compared to the situation where information about the effort of the agents is verifiable.
In all the models that we have seen in this paper, the surplus obtained in any partnership can be fully distributed among principals and agents. For instance, the cost for a principal of increasing by one unit the level of utility of an agent is also one. This is an important characteristic that makes the models share the main properties of the assignment game (with a discrete or a continuous number of agents). In particular, a matching is an equilibrium matching if and only if it is optimal. However, there are many relevant environments where this characteristic does not hold, especially when moral hazard problems are present, and then the surplus is not (at least, not fully) transferable.
Several papers study environments with a non-transferable utility to analyze partnerships and contracts in markets. Legros and Newman (2007) provide necessary and sufficient conditions for PAM and NAM in these markets. The monotonicity of the equilibrium matching requires not only the complementarity/substitutability of the surplus in types but also the complementarity/substitutability between an agent's type and his partner's payoff. Besley and Ghatak (2005) consider a market with two types of principals (profit-oriented and mission-oriented) and two types of agents (those who only care about the monetary reward and those that receive an intrinsic motivation if they work for a mission-oriented firm) and study the market assignment and contracts. Dam and Pérez-Castrillo (2006) model the interaction between landowners and heterogeneous (poor) tenants who are subject to limited liability constraints and study the consequences of competition on the power of incentives, the efficiency of the relationships, and the effect of redistributive policies. 30 Legros and Newman (2007) also propose two applications: they study the market between a set of principals endowed with projects with heterogeneous risk characteristics and a set of agents who differ in initial wealth and have a declining absolute risk aversion, as well as a "marriage market" where agents are heterogeneous in their absolute risk tolerance (see also Reny 2016 andGierlinger andLaczó 2018). Alonso-Paulí and Pérez-Castrillo (2012) analyze the owners' choice between an incentive contract or a contract with a rigid effort of managers, who are heterogeneous in their ability, in an environment where there is uncertainty concerning market conditions. Ghatak and Karaivanov (2014) study the equilibrium sharecropping contracts in a model with endogenous matching and double-sided moral hazard.
Finally, we discuss some of the empirical literature related to situations with incentives and moral hazard using data from markets where the match principal-agent is not exogenous. Note that, unlike single-agent choices, matching outcomes depend on the preferences of other agents in the market. 31 Recently, several papers have proposed estimation strategies adapted for matching situations, and some empirical papers estimate two-sided matching situations with (and without) transfers. 32 Some papers use reduced-form models, as the "probit-counterfactual" approach (see, Gompers et al. 2016). This approach uses data on the actual pairs to construct a plausible set of counterfactual pairs (control group) of available alternatives to the actual partner. Then, it estimates the likelihood of an agent being matched with an actual rather than an alternative partner. 33 Following this approach, Agrawal et al. (2008) use the spatial and social proximity of inventors to explain the access to knowledge. Hegde and Tumlinson (2014) find that ethnic proximity between U.S. venture capitalists and start-up executives is positively related to the start-up's successful exit and exit revenue. Also, Gompers et al. (2016) find that, in addition to ability-based characteristics, venture capitalists choose to collaborate with other venture capitalists for affinity-based characteristics and show that homophyly is detrimental for the investments.
Another empirical strategy, closely related to matching theory, explicitly introduces a stochastic structure at the level of the individual matches to cope with unobserved heterogeneity among the market participants. Given that monetary transfers between matched partners are often not observed, the goal is to provide estimations of the aggregate surplus that is divided between matched partners. In the TU games this approach was introduced by Choo and Siow (2006), who show that the matching surplus can incorporate latent characteristics (heterogeneity that is unobserved by the analyst). Building on that seminal paper, Chiappori et al. (2017) estimate the changes in the returns to education in the US marriage market, whereas Galichon and Salanié (2015) study the cross-differential effect of variation in the attributes of the two sides of the market (such as whether education matters more for conscientious men/women than for extroverted ones).
Also related to matching theory, Fox (2018) proposes a maximum score estimator for matching situations where transfers are endogenous but not in the data. This maximizes the number of inequalities implied by pairwise stability that hold true. Fox's (2018) maximum score method has been used in several papers. Bajari and Fox (2013) estimate the bidders' valuation with data on the US auction of licenses of radio spectrum for mobile phone service and find that the final allocation of licenses was inefficient. Levine (2008) explores the matching of biotechnology innovations to marketing firms. In the case of bank mergers, Akkus et al. (2015) adapt Fox's (2018) maximum score estimator for the case of the availability of data on equilibrium transfers. They find that merger value arises from cost efficiencies in overlapping markets, the relaxing of regulation, and network effects exhibited by the acquirer-target matching. Banal-Estañol et al. (2018) use the method to study the characteristics of the equilibrium matching between UK academics and firms for grant applications.
Given its interest both from the theoretical and the empirical perspective, we expect that considering moral hazard problems in markets will allow researchers to increase the understanding of important economic questions.

Compliance with ethical standards
Conflict of interest Inés Macho-Stadler declares that she has no conflict of interest. David Pérez-Castrillo declares that he has no conflict of interest.
Ethical approval This article does not contain any studies with human participants or animals performed by any of the authors.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.