All perfect praise be to Allaah, The Lord of the worlds. I testify that there is none worthy of worship except Allaah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
It is impermissible to work in a job that involves committing prohibited acts or helping others commit them. There is no doubt that there are endless ways of earning a living through lawful means available for whoever sincerely seeks after them.
If the jobs in reference involve conducting prohibited contracts and transactions, as you have stated in the question, then it is not allowed for you to work in either of them unless you cannot find any other lawful job and you need to work in order to earn a living and provide for yourself and your dependents. In this case, it is permissible for you to work in such a job, but you are obliged to quit it whenever you find a lawful job opportunity because necessity is measured in accordance with its true extent and must only be answered proportionately.
You should bear in mind that whoever gives up something for the sake of Allaah, Allaah will compensate and substitute him with something better, and whoever fears Allaah and adheres to Taqwa (piety and righteousness), Allaah will facilitate his affairs for him, bless him with sustenance, and provide for him from (sources) that he never could imagine. Allaah, The Exalted, says (what means): {And whoever fears Allaah - He will make for him a way out. And will provide for him from where he does not expect.} [Quran 65:2-3]
Allaah knows best.