Slice or dice your onions. Use a food processor or a cutter if you have one handy.
Heat a generous amount of oil in your IP on saute mode.
When it is hot add the whole spices and saute for 30 seconds
Add the onions, keep stirring and cook for about 10 minutes until the edges/tips of most of the onions are slightly golden. For a darker curry base keep cooking (and stirring) for 15-20 minutes - usually it is safer to go for a light golden.
Now add your ginger and garlic pastes and saute for 2 minutes
Once they pastes are incorporated add the remaining dry masala and salt and saute until the mix starts to come together and form a cohesive paste. If it starts to burn add a small splash of water. When it is done the oil will rise to the top.
Pour 2.5 cups of hot water into the Instant Pot, give it a stir and put it on manual (pressure) for 20 minutes.
Let it naturally release and saute to reduce the liquid for a more concentrated base. If you want you can use an immersion blender to puree it at this point.
When it is cool enough to handle then drain the extra oil out of the masala.
This mix will keep in the coldest part of your fridge for 10 days or you can freeze it into roughly one cup servings for 3 months.