The growth and expansion of economic concepts in the power system is increasing in last years. Energy economists have considered the optimal decision-making of electricity market retailers in recent years. In this paper, a demand response program based model is pro-posed in order to make the optimal decision of the retailer in the electricity market, taking into account the different conditions that the retailer may face. The optimal model presented by mod-eling the behavior of retailers and consumers, while maximizing the profit of retailers, also leads to the optimal purchase of retailers from conventional contracts in the electricity market. The formulation of the proposed model is based on the presence of the retailer in the bilateral con-tracts as well as the pool market contracts in such a way that the optimization problem is solved in the form of nonlinear programming with SNOPT solver in GAMS software. The results indicate the effectiveness of the proposed model based on the fact that while increasing the retailer profit, the retailer purchase is also managed in the bilateral contract and the pool market.