deuxhero
I of course thought of simply having an "upgrade your shit for XXX money" system, but that carries a lot of problems of its own, as you pointed out. I don't think that's a good venue to follow in terms of economy. No, the traditional approach where you go to shop to buy a new item seems to me to be the most promising one, its only problem being that after a while, you run out of interesting things to offer. This can be countered by various ways, the most obvious one being to stop giving the player everything he needs within a dungeon – at that moment, the shops become entirely redundant. Optimally, the player shouldn't get any gear from a dungeon dive at all, or maybe a single piece of gear if it's thematically appropriate. The shop needs to be the main source of equipment if the in-game economy is to have any chance at all. Of course, you do not want the game to turn into a loot treadmil like in D:OS2. I understood the attempt they made to crack this issue, but levelled gear is just massive cancer. Ideally, you would not change what the shop is offering. If bumpkintown only has three kinds of armour, then it should still have those same three armours at game end (thus avoiding loot treadmill). The second step to a functioning economy would then be to motivate the player to stop skipping tiers.
Imagine you are a fighter who seeks a new sword to replace his bronze one. The shop has an iron one, a steel one, and a mithril one on offer. In my experience, almost nobody will ever buy the iron one. They will go "well, I can just power through one more dungeon with this bronze sword, and then splurge out on the mithril or steel one". This behaviour, while perfectly logical from the financial side, is not something you want the player to do if you want a robust economy – a significant price gap between the tiers or limited availability (bumpkintown only has the iron sword, sorry, use your excess money to buy a better armour here or gear up your other partymembers) or a combination of both. Of course, there should be an appreciable difference in power between an iron sword and a steel one, so that the player really desires to upgrade his shit. Only when you have these systems set up, sure that the player should, at all times, have something to desire in the shop, should you focus on fine-tuning the availability of money. But that's very often the easy part, where you either nerf the sell prices or limit the availability of loot.
Sadly, I don't think I've seen a game fine tune its economy to the point where this would work throughout the entirety of the game. I saw some respectable attempts (modded Gothic 2 comes to mind) where they managed to keep it going for half the game, but sooner or later, the system breaks, either when the player finds a way to make way too much money way too quickly or when the shops stop having anything worth buying. Really, I consider a solid in-game economy of this kind to be the next milestone in game development, and I hope it'll be achieved soon.