DnD 5e - The Economy
It's unusual to consider the details of the economy in a game, which is why the official rules don't do it in any specific way. When you're slaying dragons and saving the world from demonic invasions, the fluctuations in grain prices don't really matter. Dungeons and Dragons isn't a game about a mundane medieval economy, so there aren't rules for managing an economy.
If you examine the prices of items, the suggested incomes for NPCs (1gp a day for a skilled artisan, 1sp a day for unskilled laborers), the price of living expenses (see Downtime: Lifestyle, earlier in this guide), and the listed prices of items in the Player's Handbook and try to match them up, things don't make a whole lot of sense.
Honestly the best you can do is to try not to think about it too much. I've delved into the math of a lot of the systems underlying 5th edition Dungeons and Dragons, and if the math isn't directly related to adventurers going on adventures, it's usually a mess. A lot of background stuff like a workable economy was ignored in favor of making a game that's actually fun to play, and while simulationists and crazy people like me are occasionally disappointed by those decisions, focusing on making the game fun rather than mathematical flawless is one of the reasons that so many people enjoy 5th edition.