All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
Allah has strongly Warned against eating the property of orphans unjustly. Allah Says (what means): {Indeed, those who devour the property of orphans unjustly are only consuming into their bellies fire. And they will be burned in a Blaze.} [Quran 4:10]
Besides, the Prophet severely condemned this act as he said: “Avoid the seven great destructive sins.” They (the people) asked, “O Allah's Apostle! What are they?” He said, “To join partners in worship with Allah; to practice sorcery; to kill the life which Allah has forbidden except for a just cause (according to Islamic law); to eat up usury (Riba), to eat up the property of an orphan; to give one's back to the enemy and fleeing from the battlefield at the time of fighting and to accuse chaste women who never even think of anything touching chastity and are good believers.”
In the light of the above details one, should strictly avoid consuming the property of an orphan without any legal right. Instead of consuming it, he is obliged to manage it wisely in order to flourish it and keep it from being devalued.
The Prophet said: “If anyone is a guardian of an orphan who owns property, he must trade with it and not leave it till the Sadaqah (Zakat) consumes it”. [at-Tirmithi and he said this is a weak chain] Though these words might not be from the Prophet but it is proved from Umar (may Allah be pleased with him).
Any guardian of an orphan's money can invest it in business with his property or separately. So, what you did is permissible as long as you intended to benefit orphans.
Allah Says (what means): {They ask you about orphans. Say, "Improvement for them is best. And if you mix your affairs with theirs - they are your brothers. And Allah knows the corrupter from the amender.} [Quran 2:220].
When you make business to benefit orphans and protect their wealth from being destroyed, you may provide your services free of charge, which is recommended and highly rewardable by Allah. Or you may take your service charges or a certain percentage on profit, an amount similar to that paid for people providing the same services you are providing. But the perfect way is to make the business as partnership between you and the orphan who is under your guardianship. That means that you take a certain percentage of profit against your business activities in addition to the percentage of your capital. Know that both of you should share the percentage of profits and losses. We draw your attention to an important point that if you have losses in your business frequently because of lack of experience, etc., then you should not risk using orphans' money, but you should give it to a trustworthy and eligible person to carry out this task successfully.
Allah knows best.