It is a spatial hydraulic-linkage mechanism of the lift-arm luffing mechanism of rotary drilling rig. During the operation, all of the reaction forces (torques) acting on the drill are transmitted to the swing platform by the mechanism. The design quality of the mechanism has a direct effect on the dynamic performance of the rotary drilling rig. A model based on the SWDM-22 rotary drilling rig developed by Hunan Sunward Intelligent Machinery CO., LTD was applied for the optimization study. The Lagrange equation was established on the basis of dynamic mechanics analysis of the equivalent planar hydraulic-linkage mechanism. The load of the hydraulic cylinder of lift-arm was solved and the objective function of the dynamic optimization was established. It is a relative complicated mechanism of the working device and the complete set of constraints were constituted by formulating the structural constraints, position constraints, kinematic constraints, dynamic constraints, and construction safety constraints respectively. The genetic algorithm was adopted to implement the dynamic optimization in consideration of the characteristic of the mathematical model. An optimized design was obtained and the value of the objective function was reduced by 12%. Some discussions about the influence of the evaluation of design variables on the objective function were made and some useful results were obtained.