The Messenger of Allah ﷺ said, "Do not sell gold for gold except in equal measure, nor silver for silver except in equal measure, but sell gold for silver and silver for gold however you wish."
قال رسول الله ﷺ: لا تبيعوا الذهب بالذهب إلا سواء بسواء، والفضة بالفضة إلا سواء بسواء، وبيعوا الذهب بالفضة، والفضة بالذهب كيف شئتم.
Bukhari narrated it in the Book of Sales (2175), and Muslim in the Book of Sharecropping (1590), through the route of Yahya bin Abu Ishaq, who said, Abdul-Rahman bin Abu Bakra narrated to us, saying, Abu Bakra said, and then he mentioned it.