We study a model in which heterogeneous agents first form a trading network where linking costs are positive but infinitesimally small. Then, a seller and a buyer are randomly selected among the agents to bargain through a chain of intermediaries. We determine both the trading path and the allocation of the surplus among the seller, the buyer and the intermediaries at equilibrium. We show that, under the initiator bargaining protocol, a trading network is pairwise stable if it is a core–periphery network where the core consists of all impatient agents who are linked to each other and the periphery consists of all patient agents who have a single link towards an impatient agent. Once agents do not know the impatience of other agents, each bi...