Press the sauté button and add the besan to the instant pot. Dry roast the besan by stirring for 10 minutes, or until it smells a bit toasty and the color darkens by a shade or two. Remove the besan from the pot and set it aside in a bowl for now.
Add the sweet potatoes and water to the pot. Secure the lid, close the pressure valve and cook for 10 minutes at high pressure.
Open the valve to quick-release pressure.
Press sauté, add the ghee, stir, then add the roasted besan, sugar, raisins and ground cardamom. Stir this continuously for 10 minutes or until the halwa comes together - it'll be a bit of an arm workout. A fun workout though!
Garnish with nuts and serve warm.