Transaction costs play a significant role in financial markets, and many studies have been conducted on this topic to date. Research on this topic may be divided into two categories. The first category of studies examines the optimal trading strategy of the investor who has to pay transaction costs. The second group investigates the optimal transaction costs that ensure the market operates as smoothly as possible, while retaining the profits of the market maker. We consider simultaneous optimization by the investors and the market maker, and analyse the impact of market parameters on the optimized transaction costs.