Heat ghee in a thick-bottomed pan. Add onions and sauté on medium heat till light golden. Add ginger and garlic pastes and green chillies and sauté for a minute.
Add tomatoes and salt and sauté for another two to three minutes. Add red chilli powder and turmeric powder, mix well and cover and cook on low heat till tomatoes are done and ghee surfaces on top. Add garam masala powder, vinegar and chopped coriander leaves and stir to mix well.
Flatten the cooked mixture evenly in the pan and make four depressions using a spoon or a spatula. Break each egg separately in a cup and gently slip into the above cooked mixture so that the yolks fall into the depressions. Adjust seasoning and cover and cook on low heat for two to three minutes or till eggs are done.