In this paper, a distribution system operator (DSO)framework is proposed to optimally coordinate distributed energy resources (DER) aggregators' comprehensive participation in retail energy market as well as wholesale energy and regulation markets. Various types of DER aggregators, including energy storage aggregators (ESAGs), dispatchable distributed generation aggregators (DDGAGs), electric vehicles charging stations (EVCSs), and demand response aggregators (DRAGs), are modeled in the proposed DSO framework. Distribution network constraints are considered by using a linearized power flow. The problem is modeled using mixed-integer linear programming (MILP) which can be solved by commercial solvers. Case studies are performed to analyze the interactions between DER aggregators and wholesale/retail electricity markets.