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 -100)
 * They are in trading range

Trading Range
Trade range is expanded by 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. Also, there is the special case of the Tyrrenean Sea and Adriatic Sea nodes which are counted as neighbors for this system. Each neighboring node that has an owned province in it is linked, expanding trade range, and this can be chained across the world. If a merchant is placed in a node with an owned province then adjacent nodes are added to trade range, and a merchant can also be placed in one of those neighboring nodes to make that node in tradeable. Note that this can only be done adjacent to nodes with owned provinces and also does not allow filling in gap nodes in chains for continuing trade range. Sectors can then trade with all same-nation sectors in trade range, and all other nations’ sectors in trade range that are in nodes in tradeable state, if the sectors meet the other conditions.

Trading range of each sector is determined by the following process. The sector itself is within its trading range. If the owner has no merchant, end trade range check. If not, proceed. If its owner has placed a merchant in the sector’s trade node, or if the sector is within the owner’s home node, every other sector within the trade node owned by non hostile countries are within its trading range. If the owner has another non-empty sector in a trade node that has a connection with this sector’s trade node, then that sector is within its trading range. These sectors will be referred as jump sectors. If a jump sector has a merchant placed by its owner in its trade node, then every other sectors within the trade node owned by non hostile countries are within its trading range. If the owner has another sector in a trade node that has a connection with jump sector’s trade node, then that sector is also within trading range and also becomes a jump sector. Repeat until no new sector can be added into the trade range.

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.

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.

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.

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 a province in S0 trades directly with one of your own provinces in S2 (or a province belonging to another country that is part of that N2), 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%.

= 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.

= 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 for higher ones such as major or dominant, by having some portion of total trade power within the node. Their key role is in providing merchant to whoever owns the province.

Note these numbers are outdated due to frequent balance changes

Minor Center of Trade: - Trade power >= 4 OR (Trade power >= 2 AND (trade post OR owned by colonial nation))

Important Center of Trade: - Trade Power >= 10

Major Center of Trade: - (Trade Power >= 30 AND Trade Power Share >= 15%) OR (Trade Power >= 60 AND Trade Power Share >= 7.5%)

Dominant Center of Trade: - (Trade Power >= 60 AND Trade Power Share >= 30%) OR (Trade Power >= 120 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.

Minor Center of Trade: - 0.05 base merchant

Important Center of Trade - 0.15 base merchant

Major Center of Trade - 0.5 base merchant

Dominant Center of Trade - 1 base merchant

Number of Merchants = Sum(base merchant) + 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