Trade

Trade in M&T has two components. An all new market system where trade goods are exchanged between provinces and the regular trade system which distributes the profits from exchanges in the market system.

Sectors
Provinces are grouped in sectors, and each nation with provinces in a trade node has a sector in that trade node consisting of its provinces in that node. Sectors handle the task of: A bid is a sector saying to the world ‘I want to buy this type of good up to this quantity for at most this price’. An offer is a sector saying to the world ‘I want to sell this type of good up to this quantity for at least this price.’
 * Summing up supply and demand from its member provinces
 * Organizing summed supply and demand into bids and offers
 * Resolving its bids and offers through trade with other sectors
 * Creating, maintaining, and utilizing a stockpile of goods

Trading Conditions
For sectors to be able to trade with each other they must meet these conditions:
 * Their nations aren't at war
 * Their nations aren't embargoed in either direction
 * Their nations' relations aren't abysmal (above -150)
 * They are in trading range

Trading Range
Trading range is which nodes a sector can trade with. Initially a sector can only trade within itself. By placing a merchant in the sector's node its trade range now includes that node and it can trade with other sectors in that node. Trade range can be expanded by placing merchants and linking neighboring nodes. Nodes are neighbors if they have an incoming or outgoing connection between them, as can be seen in the trade map mode. Each neighboring node that has an owned sector and a merchant in it is linked, expanding trade range, and this can be chained across the world. A neighboring node that does not have an owned sector in it, but is next to a node that does contain one can also have a merchant placed in it to add it to trading range, but ending the expansion of trading range. Note that this can mean despite being a complete chain of merchants due to not owning a sector in a middle node there are two separate groups of sectors and respective trading ranges. Sectors can trade with all other sectors in trade range, if the sectors meet the other conditions.

Examples
We have nodes N0 -> N1 -> N2 -> N3. We own sectors S0, S1, and S3 in nodes N0, N1, and N3, respectively.


 * If we place a merchant only in N0, then S0 would only be able to trade with other sectors in N0, and not with sectors in any other nodes.
 * If we place merchants in N0 and N1 then S0 and S1 can trade with all sectors in N0 and N1.
 * If we place merchants in N1 and N2 then S1 can trade with all sectors in N1 and N2.
 * If we place merchants in N0, N1, and N2 then S0 and S1 can trade with all sectors in N0, N1, and N2.
 * If we place merchants in N0, N1, N2, and N3 then S0 can trade with all sectors in N1 and N0. S1 can trade with all sectors in N0, N1, and N2 and S3 can trade with all sectors in N2 and N3.

England's capital is London which is part of the Northwest Atlantic trade node. England owns Lancaster which is part of the North Sea trade node. For the sector which includes London to trade with the sector that includes Lancaster England would need trading range between them. Since they are neighboring nodes England just needs a merchant in each and since London is the capital that means England only needs to have a merchant in the North Sea to enable market system trade between Lancaster and London.

Bids and Offers
Resolving of bids and offers is done by the following process. Every sector is assigned a score. The sector with the highest score is selected. Selected sector checks through every sector within its trading range to find the best bids and best offers. When that is found, it resolves its bid and offer with whatever was found. Repeat until no new bid or offer can be resolved. Select the sector with the next highest score, and do the same. Repeat until no new bid or offer can be resolved by any sector.

Tariffs
1. Every country has a tariff rate on every 12 tradegoods

2. Every sectors owned by that country fetch tariff rate from their owner

3. There's smuggling rate, which is increased by high tariff rate and decreased by state reach * (100 - local autonomy)

4. Effective tariff rate is tariff rate * (1 - smuggling rate)

5. Tariff is raised during trade

Tariffs affect behavior by decreasing expected profit when deciding who sectors resolve bids/offers with.

Tariffs income is represented by tax and does not need ADM or DIP points. You can see tariff income on the second page of the provincial administration modifier.

Fees
Trade that goes through sectors pays a fee.

Suppose there are trade nodes N0 - N1 - N2 and you have provinces in each node, creating sectors S0 - S1 - S2. If sector S0 trades directly with S2 (or a sector belonging to another country that is part of that N2 as well), it has to pay a fee of 10% of the transaction value to S1 since trade flows through there. The more sectors trade has to go through, the higher the fee will be when trade happens. So if we have N0 - N1 - N2 - N3 - N4 and N0 trades with N4, the fee would be of 30%.

The cost of this fee is considered by the merchants before deciding who to trade with.

N.B. This fee is different from the fees paid as taxes by your population!

Stockpiles
Every sector has a stockpile for each type of good. Every stockpile has 4 variables, its desired size, current size, bid, and offer. For every iteration of economy, stockpile does the following. bid = (desired size - current size) / 2 offer = current size / 2 stockpile’s own bid and offer are added on top of sector’s bid and offer to be resolved together. desired size := desired size * 0.875 + how much of offer was sold If desired size > sector commerce production * 20 / price, then desired size is capped to that value. If desired size < sector demand * 4, then desired size is locked to that value. Each sectors hold their own price belief for each goods, which determines how much wealth they are willing to pay or is going to ask for when they buy or sell goods. For every iteration of economy, price := price * X, where X < 1 when desired size < 2 * current size, and X > 1 when desired size > 2 * current size. At the time of writing, 0.8 <= X <= 1.2 Prices are capped below at 0.1 and above at 100.0, at time of writing At the end of each iteration, each member province of the sector fetches the price variables from their respective sector and saves that in itself. Then, at the start of each iteration, each sector sum and average out the price variables from their respective member provinces. This accounts for when sectors change size or are created. When trade occurs, every margin is distributed to commerce producing industries as income. A portion of wealth owned by commerce producing industries gets turned into trade value, which is then collected by states via vanilla trade system.

Market System actors and phases
There are 2 players and 4 actions that facilitate all trade.


 * Actors
 * The Sector (or S) representing itself, meaning that a Sector is made up of everything in the provinces within it that can produce or demand goods. Specifically, it includes the population -classes-, the maintenance and building of infrastructure, the maintenance of property - meaning the units of farmland, forestry, mines, fisheries, industrial, academic and commercial the urban industry which is the only kind of industry that uses goods as input to produce its output goods. For an explanation on property, industry and much more, see Industry guide
 * The Trade-holders (or H) belonging to the sector. They have their own stockpile of goods.

It is imperative to distinguish between the trade-holders and the burghers. Trade-holders refers to the owners of the commerce industry, the stakeholders, who could be any class or the state and with the exception of the state, they are local to each province. They own the stockpiles, pay the wages of the labour and profit or lose money depending on how profitable trade is. The burghers refers to a class and the population of that class can be hired as labour for the commerce industry. They would be the people who get on wagons, carts, ships and caravans and journey from place to place with goods to trade, but those goods need not be their own. They are getting paid a wage, so long as they are employed as labour. Only burghers can fill the role of labour in the commerce industry. It is not necessarily the case that the burghers are themselves trade-holders. They can be however, in which case they pay wages to themselves, as well as sharing in on the profits or losses depending the % of the commercial district they own. Without burghers, the commerce, as a concept within the mod, doesn't exist, and without it everything that remains is, by definition, subsistence.''


 * Phases (In the order they happen in-game)
 * It all starts with subsistence goods being bought and sold within S. Subsistence goods are those that the sector will be unable to sell to H and are thus traded e.g. farmer to farmer. The costs and profits of these transactions are distributed according to how many units of subsistence were bought or sold*. Essentially it is the industries -except commerce- selling to themselves and to all the other constituents of the S. The commerce industry is entirely absent from this process.
 * * In short: Profits = - Costs = (units_of_good)*(price_of_good) for each transaction.
 * Next, S sells (and only sells in this phase) the goods to H. Since the only ones producing goods within the sector are the industries, only they get profits based of the formula above. This happens exclusively within the sector, with the H paying the industries for the goods bought. As a result the stockpile of H increases.
 * A key aspect of this is that the industries can only sell as much as H want to buy. Whatever isn't sold, is lost forever.
 * This is a result of concept of optimal stockpile. Based on the profitability of the previous year of trading, H decides whether to increase, maintain or shrink its optimal stockpile with the ultimate purpose of minimising losses and maximising profits. Said stockpile is different for each good and also acts as the maximum amount the H is willing to buy.
 * Now that H are stocked up, both the industries, property, infrastructure and the population of S will attempt to buy as much as they need from the stockpile of H. This stockpile is the combination of what H bought from S in the previous phase  and  whatever spare goods they had from previous trade iterations -foreign trade included, see next phase (4) for details (definition: iteration n. The act or an instance of iterating; repetition). This all still takes place exclusively within the sector. In the current phase the industries,the property owners, the infrastructure fund and population of S lose money which H gains.
 * Q: Perhaps you wonder why whatever isn't sold, is lost forever. What if my sector produced 100 units of food (after subsistence transactions have been concluded) and H only bought 20. What if my sector then needs 80 units of food? H would only have 20 to sell (supposing no leftovers from previous iterations). Wouldn't it make more sense in that scenario that they (H) could use the spare food to fulfill their demands later?
 * A: No, because industries cannot sell to other industries, nor to infrastructure nor to classes nor to anyone. Without burghers commerce, as a concept within the mod, doesn't exist, and without commerce everything that remains is, by definition, subsistence.
 * Finally, with whatever stockpile H are left, they go and trade with the world seeking to, in that particular order:
 * i) filling their stockpile at the lowest possible cost, up to the optimal stockpile limit
 * ii) selling from their stockpile as much as they think will yield them the most profit
 * For an inter-sector transaction to be concluded, both sides need to agree. One will want to buy to fill its stockpile to the optimal amount and the other will see profit in selling. Thus trade cannot be forced by one side meaning it is strictly consensual.
 * The profits made are distributed to the provinces based on the Commercial Output of each and are then further divided between the provincial owners of commercial property according to the % they own.
 * An organic situation will then develop. If the H had an unprofitable year, the next one, their optimal stockpile will shrink, and as a result they will want to buy less goods from the industries, as seen in phase 2. So when the industries come knocking on the door of H saying "Hey, wanna buy? ;)", the H could very well go "No, we already have enough we didn't sell last year". This means everything the industries worked for that year will be lost, leading to no profits which in turn leads to industries shrinking following their survival instinct code. In reality it's nigh impossible for the entirety of industry goods to be discarded but any goods lost translate to reduced profitability.
 * In the reverse situation, if the H were able to sell the entirety of their stockpile then that "no" will turn into a "yes". The H, even if their sector produced nothing, could, potentially, still make a profit from buying and selling from the stockpiles of some sectors to the stockpiles of some others.
 * Of course, only the commerce industry will profit in that scenario, because as the rest of the industries sold none -realistically less, but at least some- of their goods, they will get no profits -again, some lesser amount of profit. The opposite is very unlikely to happen. Industries cannot prosper longterm if their merchants don't have a capacity for buying, unless the sector is highly subsistent.

There are a couple of corollaries that derive from here.

So in summary, industries (except Commerce) make a profit based on how much the Hof their own sector can buy from them, while the Commerce industry earnings depend on selling at higher prices than what the goods were bought for.
 * 1) If a sector has leftovers goods each year, it means investing in commerce is probably a good idea. You want your merchants to be able to buy 100% of what your industries produce.
 * 2) If merchants are buying 100% of the goods and still making huge profits, invest in your industries. They will make good profits themselves.

= Summary of Trade and Differences from Vanilla =

Trade system is a system that handles the movement of goods from one province to the other. It achieves that by creating a provincial market in each provinces, where each goods are assigned a price which varies depending on supply and demand. If the price is low, then the province will export its surplus to other provinces where the price is high. Every such transactions create a trade value in a province where the transaction is being made. That trade value can then be collected by the states based on their trade power share, just as how it's done in vanilla.

All trade related sector income (including Fees) are distributed to commerce industries amongst the provinces belonging to that sector based on the commerce production/output share. Provinces with higher commerce output get a higher cut of the trade, and countries can then tax that.

= Trade Nodes =

Trade nodes work in the same way as they do in vanilla. Provinces generate trade value, they get summed up in trade nodes, which the states then collect based on their trade power share.

= Provincial Trade Value (Largest section) =

Trade value is mainly determined by how much trade is moving through the province. For example, suppose there are 3 sectors A, B and C. If A is trading with C through B, then the good flows from C to B and then to A. At each stop of the way in all 3 sectors, depending on how much and at what price the goods are being traded, corresponding amount of trade value will be created.

Trade Links
Trade link can be seen as something that enables trade between two sectors. First, trade link is formed between any two neighboring sectors, where neighborhood is defined as any two sectors that are either in same or neighboring nodes (vanilla trade link connected), if sector owner has placed a merchant in the two nodes, and either owns both the sectors, or has a relationship higher than -50 with the other owner and is not at war or is in embargo with that country. Then, for every sector that has a trade link with other same owner sector, they both expand their trade link with all trade links opened by the others, which is looped until no new trade link can be added.

= Trade Centers =

Trade centers are modifiers that represents the varying levels of commercial activity within a province. It is enabled by having some level of trade power and by having some portion of total trade power within the node in different variations. Their key role is in providing merchant to whoever owns the province.

Note these numbers are veryfied for alpha 18, and can be changed in future updates

Minor Center of Trade: - Trade power >= 2.4 AND Trade Power Share >= 1.2% - Trade power >= 0.5 AND (trade post OR owned by colonial nation)

Important Center of Trade: - Trade Power >= 5.6  AND Trade Power Share >= 5% - Trade Power >= 6.8  AND Trade Power Share >= 4%

Major Center of Trade: - Trade Power >= 3.8 AND Trade Power Share >= 40% - Trade Power >= 7   AND Trade Power Share >= 30% - Trade Power >= 10  AND Trade Power Share >= 20% - Trade Power >= 14.5 AND Trade Power Share >= 10%

Dominant Center of Trade: - Trade Power >= 14 AND Trade Power Share >= 60% - Trade Power >= 19 AND Trade Power Share >= 50% - Trade Power >= 34 AND Trade Power Share >= 30% - Trade Power >= 48 AND Trade Power Share >= 15%

= Trade Power =

Trade power represents the power its owner can exert over the commerce that occurs within its node. Its main source will be provincial trade power, which is directly tied to how much commerce a given province produces.

Global Trade Power
Explanation of global trade power and list of ways to get it.

Domestic Trade Power
Explanation of domestic trade power and list of ways to get it.

Trade Power Abroad
Explanation of trade power abroad and list of ways to get it.

Trade Steering
Explanation of trade steering and list of ways to get it.

Inland Bonus
Explanation of inland bonus and list of ways to get it. Note, this replaces vanilla caravan power.

= Mercantilism =

Description of what it is/does.

= Merchants =

Importance of merchants in 3.0 cannot be understated. Their presence enables foreign trade, and allows direct long range business transactions. Your capital node is always considered as having your merchant regardless of their actual presence.

Gaining Merchants
You can gain more merchants by owning more trade centers and picking certain ideas which increase merchants gained from those trade centers. If you own any level of any center of trade, regardless of its level and numbers you are guaranteed to get at least one merchant. Your capital province, if a trade center, provides +200% more merchants than it normally would. All modifiers stacks additively with each other, except non-accepted culture malus - x0.5 for owner culture group, and x0.25 for others

Minor Center of Trade: - 0.2 base merchant

Important Center of Trade - 0.4 base merchant

Major Center of Trade - 1.5 base merchant

Dominant Center of Trade - 3 base merchant

Number of Merchants = Sum(base merchant)/2 + 1.55

Trade Range
Explanation of what trade range is and list of ways to increase it.

= Trade Policies =

Explanation of node trade policies, including the effects of and requirements for each.

= Embargo =

Description of what the embargo diplomatic option does.

= Promote Trade =

Description of what the promote trade diplomatic option does.

= Privateering =

Description of how privateering fleets impact trade.

Privateer Efficiency
Explanation of Privateer Efficiency and list of ways to get it.

= Relevant Files =

List