We examine the evolution of decentralized clearinghouse mechanisms from the 13th to the 18th century; in particular, we explore the clearing of non- or limitedtradable debts like bills of exchange. We construct a theoretical model of these clearinghouse mechanisms, similar to the models in the theoretical matching literature, and show that specific decentralized multilateral clearing algorithms known as rescontre, skontrieren or virement des parties used by merchants were efficient in specific historical contexts. We can explain both the evolutionary self-organizing emergence of late medieval and early modern fairs, and its robustness during the 17th and 18th century.