Alright, I finished implementing the core systems. Still have some way to go before initial prototype, but for those who are interested this is how the new model works.
The goal is to create a M&T-like economy experience for ck3. It can be divided into two parts, the production and the trade, where production handles the production of goods while trade handles its distribution. Let's start from production.
To explain production, I must first get into how the lowest layer of this model is composed of. At the bottom, there are holdings, which are part of counties. Holdings have an owner, a pop, a land, and a set of industries. Pop represents people in servitude to the owner, while land represents land assets owned by the owner. Owner must pay for all the land and pop cost, but gets to own all the income generated.
Above that, at the county level, there are also pops and lands, but they are not tied to any owner. They are free, own their own assets, and have their own pool of wealth which they use to consume goods.
Pops and lands are utilized by industries located in the same holding/county which represent a set of activities that together produce goods. Industries are distributed with pop and land based on their expected profit, and they combine received pop and land to calculate their size, which determines their throughput.
Goods produced by industries are sent to the county level stockpile, while keeping track of which holding/free pop contributed what share of which good into the county stockpile. When goods in the county stockpile get sold, its income is distributed to holding/free pop based on ownership share.
Trade is done by special entities that I call merchants. Merchants represent a set of commercially minded people/organizations that has a home location and a resource called trade power. At each economy tick, merchants use travel time script to calculate which counties are within its reach and how far the distance is. When a merchant conducts a trade with any county(or any other merchants whose home is within reach), trade power is deducted with an amount equal to trade volume * travel distance. As this trade power resource is limited, merchants will not take every deal possible but instead focus more on profitable deals, until they gain more than enough trade power.
Summary of the whole structure is as follows. There are pops who work in industry to generate goods. Pops demand and consume goods themselves, and the county will sum up all the surplus and put them up for sale. Nearby merchants will pick up the deal if it's profitable enough and if it has enough trade power to do trade, which will move the good from the county to the merchant in return for monetary payment, which gets distributed back to the holding owners and free pops. Merchants can then sell this good to other counties and/or other merchants for higher price, keeping the price difference in its pocket, which it will spend to expand its trade reach by building outposts and increasing its trade power.