Clearly, the merchants have the "buy low, sell high" practice down, but what if the PCs want to do a little mercantile campaign? What if they want to profit without resorting to tomb-robbing, theft, and robbery? Plenty of adventuring could still be had in such a campaign. What would it take to make such a campaign work?
The most robust system for handling player-initiated trade in an RPG is probably
Traveller. I'd agree with those saying you should look long and hard at that and see if I can figure out how to adapt it to merchant caravans in a fantasy setting.
The other option would be running some kind of establishment. At this point it's question of how much detail you want to go into. (Which, for me, would mean "how much detail would actually be fun".)
The simplest way to do this would be to assume that the fundamental economy of D&D actually does make sense: In 3E, for example, it makes sense for a merchant to pay roughly 50% of final price of a magic item and then resell it.
Assume, therefore, that buying magic items at 50% of their final sale value allows you to earn a nice 10% annual profit. Actually, for easier math, let's assume 12%, which would mean a 1% return per month.
So there's your easy answer: If the PCs maintain a reasonable storefront, calculate their total volume of inventory (at 50% of sale price), give them a 1% profit on that volume per month.
As a model this leaves much to be desired, but it's simple. As more details are demanded, you can start tracking things like:
- What items are actually being bought and sold to generate that profit
- Reducing "effective volume" based on items they're overstocked on
- Effects of competition
- Effects of a Profession skill check
- Effect of how often the store is kept open
- Capping returns based on the size of their current market (fewer people buying a town of 10,000 than in a metropolis of 1,000,000)
- Figuring out exactly what size storefront is needed to adequately sell a given volume of magic items (and then accounting for the costs of that storefront)
And so forth.
A really easy way to develop this is to start with a very simple model and then start accounting for stuff when your players decide they want to try it. This dials the simulation into the level your players are interested in.