BACKGROUND: Lifestyle factors toward diet and physical activity (PA) may directly influence the pathophysiology of dyslipidemia. However, the associations of the specific macronutrient-to-PA ratio with dyslipidemia, and the underlying mechanisms regarding gut microbiota and metabolites, remain largely unexplored. METHODS: Dietary and PA information from 273 participants with or at risk of metabolic syndrome was collected via a food frequency questionnaire and the International Physical Activity Questionnaire. Gut microbial genera and fecal metabolites were profiled through 16S rRNA sequencing and untargeted LC-MS metabolomics, respectively. Machine-learning algorithms were applied to identify gut microbiome features of macronutrient-to-PA ratios and to construct microbiome risk score. RESULTS: Higher macronutrient-to-PA ratios, especially for high saturated fatty acid intake, were associated with increased risks of dyslipidemia, with adjusted odds ratio (95% CIs) of 2.87 (1.41-5.99) for hypercholesteremia, 2.21 (1.11-4.48) for hypertriglyceridemia, and 2.52 (1.26-5.16) for high low-density lipoprotein cholesterol. Microbiome risk scores were significantly associated with elevated levels of total cholesterol, triglycerides, and low-density lipoprotein cholesterol. Additionally, for each macronutrient-to-PA ratio, a core group of gut microbial genera were identified (eg, CONCLUSIONS: This study identified varied associations between macronutrient-to-PA ratios and dyslipidemia and depicted the potential modulatory roles of gut microbiota and fecal metabolites.