The Messenger of Allah ﷺ said, "Gold for gold is usury unless it is hand to hand, wheat for wheat is usury unless it is hand to hand, barley for barley is usury unless it is hand to hand, and dates for dates is usury unless it is hand to hand."
حدثنا أبو بكر بن أبي شيبة وعلي بن محمد وهشام بن عمار ونصر بن علي ومحمد بن الصباح قالوا حدثنا سفيان بن عيينة عن الزهري عن مالك بن أوس بن الحدثان النصري قال سمعت
قال رسول الله ﷺ الذهب بالذهب ربا إلا هاء وهاء والبر بالبر ربا إلا هاء وهاء والشعير بالشعير ربا إلا هاء وهاء والتمر بالتمر ربا إلا هاء وهاء
Bukhari transmitted it in the Book of Sales, in the chapter on what is mentioned regarding the sale of food and hoarding, hadith no. 2134, and Muslim transmitted it in the Book of Musaqah, in the chapter on currency exchange and selling gold for silver in cash, hadith no. 1586, from the hadith of Sufyan (and others), with the same wording.