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.