Is it riba?

Profit comes from an asset you own. Never from money.

You give

You receive

Amount

Timing

The hadith on exchange

Gold for gold, silver for silver, wheat for wheat, barley for barley, dates for dates, salt for salt: like for like, equal for equal, hand to hand. But when the kinds differ, trade as you wish, so long as it is hand to hand.

‘Ubada ibn al-Samit · Sahih Muslim 1587

Money for food, or anything else
No condition. Any amount, now or later.
The same thing for the same thing
Equal for equal, and hand to hand.
Money for a different money
Any amount, but hand to hand.

Money follows the ruling of gold and silver, since those were the money the hadith names.

Choose a deal

The five hadiths
1
Exchange
“Gold for gold, silver for silver, wheat for wheat, barley for barley, dates for dates, and salt for salt — like for like, equal for equal, hand to hand. But if these kinds differ, then sell as you wish, so long as it is hand to hand.”
‘Ubada ibn al-Samit · Sahih Muslim
Money or a commodity for its own kind must be equal and hand to hand.
2
Credit purchase
“The Messenger of God bought food from a Jew on deferred payment, and pledged his iron armour to him as security.”
‘Aisha · Sahih al-Bukhari
Buying a real asset on credit, with collateral, is allowed.
3
Deferred price
“He would buy one camel in exchange for two to be delivered later, at the time of collecting zakat.”
Reported via ‘Amr ibn al-‘As · Sunan al-Bayhaqi
A deferred price may be higher than cash. Time-value belongs to assets, not money.
4
No ambiguity
“The Messenger of God forbade two transactions in one sale.”
Abu Hurayrah · Sunan al-Tirmidhi
The price and terms must be fixed upfront.
5
Profit with risk
“Profit goes with liability (al-kharaj bi-l-daman).”
‘Aisha · Sunan Abi Dawud
You may only earn on what you own and bear the risk of losing.

وَأَحَلَّ اللَّهُ الْبَيْعَ وَحَرَّمَ الرِّبَا

“But God has permitted trade and forbidden riba.”

Qur’an · al-Baqarah 2:275

وَإِن تُبْتُمْ فَلَكُمْ رُءُوسُ أَمْوَالِكُمْ لَا تَظْلِمُونَ وَلَا تُظْلَمُونَ

“And if you repent, you may keep your principal — wronging no one, and being wronged by no one.”

Qur’an · al-Baqarah 2:279

A study aid, not a fatwa. It cannot judge the fine print of a real contract. For your own situation, ask a qualified scholar.