With the creation of competitive environments, such as electricity market, it is expected that energy networks and active consumers such as energy hubs participate in the market to promote their economic situation. So, the article proposes the optimal involvement of energy networks and hubs in energy markets in two wholesale and retail designs based on the energy management system at the same time. The proposed scheme is expressed as two-objective optimization. The first objective is to minimize the cost of different types of energy in electricity-gas-thermal networks. In another objective function, the cost of energy (which is the difference between the energy purchase cost and energy sale income) of energy hubs in the retail market is minimized. The scheme is bound to optimal power flow equations of the mentioned networks and operating model of power sources and active loads. Then, the Pareto optimization mixed with the sum of weighted functions helps extract an optimal compromise solution on the basis of fuzzy decision-making. Finally, the scheme is applied to a test system, and the obtained numerical results confirm that energy hubs are improved financially, and economic and operation conditions of the electricity-gas-thermal networks are enhanced simultaneously. So, significant profit can be achieved for EHs in the retail energy market. The economic situation of the networks enhances up to roughly 10% compared with that of power flow studies. Also, operating situation of the networks enhances by about 12% to 53% compared with a case without EHs.