We propose an agency model based on competitive markets in order to analyse an economy with several homogeneous principals and heterogeneous agents. We model the principal-agent economy as a two-sided matching game and characterise the set of stable outcomes (equilibria) of this market. In this regard we generalise the assignment game of Shapley and Shubik (1972). Unlike in the standard principal-agent theory, equilibrium payoffs of all the individuals are endogenous, equilibrium contracts are Pareto optimal, and the incremental surplus generated in a principal-agent relationship accrues to the tenant. We design a simple non-cooperative game which implements the set of stable outcomes in subgame perfect equilibrium. We also suggest policy measures in relation to efficiency and income distribution.