Dear Ahmad,
Wa alaikum assalam
You have provided two very different examples and thus this ultimately depends on the situation at hand.
Your first example consists of an awareness of something which is
against justice, the law and righteousness. Once this information has become manifest to one, their actions are not simply a case of upholding an oath or contract. One must also uphold societal obligations, the law, justice and righteousness. This is paramount.
This also finds support in the Quran where it is clear that an oath should
never become a hindrance to doing the right thing which includes justice, upholding societal obligations / upholding the law and remaining righteous.
002.224
"And do not make God (because of your swearing by Him), an excuse / obstacle / a hindrance to your doing good and acting rightly / guarding (against wrong / evil) and make peace among mankind. And God is Hearer, Knower."004.135
“O you who believe! Be custodians of justice, as witnesses to God, even if it against yourselves, or your parents, or your kin, and whether it be (against) rich or poor: for God can best protect both. Follow not the lusts (of your hearts), less you deviate, and if ye distort (justice) or decline to do justice, then indeed God is well-acquainted with all that you do” [1]Your second example is about simple contracts. One has agreed to a contract and market fluctuations are neither the fault of the seller, nor is it against the law, justice and righteousness. This is simply what happens in trade. Prices can go up and they can come down. Hence, in this example, verse 5:1 would apply and one would be expected to honour their agreements / contracts.
It is important to remember that the need for justice, upholding the law and righteousness are very different matters than simply a case of giving ones word to do an action. Every situation is different, hence, blanket/ general responses are often not helpful nor should they be sought. Often, no two situations are exactly alike and the Quran provides the obligation to honour contracts but not at the
(ill thought out - 2:225) expense of breaking the law, committing ill deeds or unrighteousness.
However, arguably, one is expected to take
serious care of their oaths and what they agree to and not to become a habitual, worthless swearer
(hallafin mahinin - 68:10).
068:010
"And yield not to / obey / heed to the type of person (despicable person), ready with oaths / habitual worthless swearer (hallafin mahinin)"At times, the Quran prescribes punishments for the breaking of oaths (5:89).
I hope that helps, God willing.
Joseph
REFERENCE:[1] STAND UP FOR JUSTICE http://quransmessage.com/articles/justice%20FM3.htm