To make the ghee: Simmer the butter in a saucepan on medium-low heat for 10 to 15 minutes. Do not stir, but delicately skim off any froth. When there are golden brown protein bits at the bottom and the butter begins to turn an amber color, take off the heat immediately. Let cool for 30 minutes, and then strain through cheesecloth into a jar.
To make the dhansak: Heat a dry pan over medium-high heat. Throw in the spices and toast for a few minutes, stirring continuously, until fragrant. Once toasted, grind the spices in a mortar and pestle, or use a coffee grinder.
To make the fried onions: Heat some canola oil in a pan over medium-high heat. Add the onions and deep-fry until dark and crisp, 3 to 5 minutes. Drain and set aside.
To make the curry: Heat the ghee in a saucepan over medium heat. Throw in the garlic, chiles and ginger, and saute until the garlic is golden, about 1 minute. Add the red onions and saute until they have some crispy, caramelized edges, about 12 minutes. Add the ground dhansak spice mix, stir and saute for 1 more minute. Deglaze the saucepan with the stock. Add the tamarind paste, lentils and sweet potatoes and simmer for 15 minutes. Remove the garlic and ginger pieces, add the chickpeas, cilantro and salt and heat through for 5 minutes.
Spoon the curry into a serving bowl. Sprinkle with cilantro and top with the fried onion slices. Serve with brown rice, naan or whole wheat pita.