Matchmaking players is an important problem in online multiplayer games. Existing solutions employ client-server architecture, which induces several problems. Those range from additional costs associated with infrastructure maintenance to inability to play the game once servers become unavailabe (due to being under Denial of Service attack or being shut down after earning enough profit). This paper aims to provide a solution for the problem of matchmaking players on the scale of the Internet, without using a central server. In order to achieve this goal, the SelfAid platform for building custom P2P matchmaking strategies is presented. After the developer creates a service algorithm defining the matchmaking behavior specific to his/hers case, the SelfAid platform designates a number of player machines to execute the service. Furthermore, the number of designated machines adapts to the demand. SelfAid uses only spare resources of player machines, following the trend of sharing economy. A distributed algorithm is presented and its correctness is proven. Keywords P2P • Games • Resource management • Large-scale distributed systems • Matchmaking 1 Introduction Video games are a popular form of entertainment. In January of 2018, Steam, one of the most successful gaming platforms, hosted as much as 18.5 million concurrent users [1]. Video games are also appealing to business. According to [2] worldwide PC game market was estimated to be worth $36 billion in 2016. The market is composed of many types of games. Some of the most popular and widely recognized categories include: simulation, strategy, action, role-playing, fighting, adventure, puzzle [3-6]. Although game genres significantly differ from one another, many games have one thing in common: they can be played between many players. Games, which additionally can be played over the Internet, as opposed