The Messenger of Allah ﷺ said, "Gold for silver is usury unless exchanged hand to hand, dates for dates is usury unless exchanged hand to hand, wheat for wheat is usury unless exchanged hand to hand, and barley for barley is usury unless exchanged hand to hand."
أخبرنا إسحق بن إبراهيم قال حدثنا سفيان عن الزهري عن مالك بن أوس بن الحدثان أنه سمع
قال رسول الله ﷺ الذهب بالورق ربا إلا هاء وهاء والتمر بالتمر ربا إلا هاء وهاء والبر بالبر ربا إلا هاء وهاء والشعير بالشعير ربا إلا هاء وهاء
Bukhari narrated it in the Book of Trade, chapter on what is mentioned regarding the sale of food and hoarding, no. 2134, and Muslim in the Book of Agricultural Partnerships, chapter on currency exchange and selling gold for silver in cash, no. 1586, from the hadith of Sufyan bin Uyayna through this route, and it is in Al-Kubra, no. 6150.