I used to sell camels at al-Baqi. I would sell them for dinars and take dirhams in their place, or sell them for dirhams and take dinars in their place. So I went to the Messenger of Allah ﷺ and found him coming out of the house of Hafsah. I asked him about that, and he said, "There is no harm in it at the current price."
حدثنا الحسن بن علي الخلال حدثنا يزيد بن هارون أخبرنا حماد بن سلمة عن سماك بن حرب عن سعيد بن جبير
كنت أبيع الإبل بالبقيع فأبيع بالدنانير فآخذ مكانها الورق وأبيع بالورق فآخذ مكانها الدنانير فأتيت رسول الله ﷺ فوجدته خارجا من بيت حفصة فسألته عن ذلك فقال لا بأس به بالقيمة
[Its isnad is hasan] Abu Dawud narrated it in the Book of Sales, Chapter on Taking Gold in Exchange for Silver, hadith no. 3354, from the hadith of Hammad bin Salama with the same wording. Ibn Hibban graded it sahih, hadith no. 1128, as did Ibn Jarud, hadith no. 655, and Hakim said it meets the conditions of Muslim, 2/44, and Dhahabi agreed with him.