In the context of global economic development and food safety, agricultural trade plays a vital role in linking agricultural production with market demand, and the efficient formulation of agricultural financial strategies is crucial for enhancing trade efficiency. This study employs advanced machine learning technologies to predict and optimize the efficiency of agricultural trade while seeking to balance the interests of various stakeholders in agricultural finance. By integrating quantile factor models, long short-term memory (LSTM) networks, and attention mechanisms, this paper conducts an in-depth analysis and precise prediction of the key factors affecting trade efficiency. This approach effectively addresses the nonlinearity and long-term dependency issues in time-series data, utilizing attention mechanisms to highlight critical information and improve prediction accuracy. Furthermore, this research establishes a multi-objective optimization model to balance the interests of agricultural finance participants, providing a new quantitative tool for formulating agricultural financial strategies aimed at optimizing decisions to enhance economic and social value. This paper offers new perspectives, methods, and empirical support for improving the efficiency of agricultural trade and the formulation of agricultural financial strategies.