Where to start with NPC Trade Routes?

Good Morning!

Had a quick question. I am wanting to create a “living economy” behind the scenes in my game similar to what you might see in X4 or Elite Dangerous. I realize this is a big under taking as the mathematical algorithms will get pretty deep. However, I am hoping someone might have an idea of where to start with this?

My initial thought is to create an NPC identity. Give it an inventory and currency system and then create the code that dictates what to buy and sell, when and where. If A and B matches, it travels to that location and makes the trade, recalculates, repeat. Do you guys think I am on the right path in my logic? Is there a better way to approach this?

Thanks!