The shiyifa 市易法 "market exchange law", sometimes called mianhangfa 免行法 "guild-avoidance law", was a method to gain control over trade monopolies. It was part of the reform policy of Wang Anshi 王安石 (1021-1086) during the Northern Song period 北宋 (960-1126) and was introduced in 1072. It targeted at the trade monopolies that had come into being with the prospering economy of the early 11th century.
In the western circuit of Longxi 隴西 (today in Gansu) the military commissioner (jiedushi 節度使) of Baoping military prefecture 保平軍, Wang Shao 王韶 (1030-1081), adapted in 1070 a method to control the flow and prices of commodities on the local market, and used them as a place to invest government funds to obtain profits. In the capital Bianjing 汴京 (Kaifeng 開封), many of the great trading companies not only controlled prices on the market in Kaifeng, but had also branches (didian 邸店) in many larger cities. Not only common customers suffered under the monopoly, but also the government whose institutions bought at large numerous commodities needed by the court or central government agencies.
Wang Anshi therefore suggested foundind a metropolitan market exchange bureau (du shiyi si 都市易司) in Kaifeng and 21 market exchange offices (shiyiwu 市易務) in other cities like Hangzhou 杭州, Guangzhou 廣州, Yangzhou 揚州 or Chengdu 成都. They were headed by supervisors (tiju guan 提舉官) and office managers (goudang gongshi guan 勾當公事官) who contacted merchants and entrusted those willing to cooperate with the management of the merchant guilds (hangpu hu 行鋪戶) and and the brokerage houses (yaren 牙人).
For all of them, prices were fixed as far as possible not only for resident merchants, but also for itinerant traders (keshang 客商). Commodities not needed on the market were purchased by the government and stored for later sales (shouxu zhuanbian 收蓄轉變) according to the Maoqian huowu fa 貿遷貨物法 "Law on the resale of commodities". In a later phase of the project, members of the guilds cooperating with the market exchange bureau were allowed to sell goods to the authorities or to buy commodities from the government storehouses, both against money, and on credit, at an interest rate of ten per cent for six months, or twenty per cent for a year. The bureau accepted that among the smaller or middle-size companies, five merchants mutually guaranteed with their assets (capital or real estate) for the credit. The jurisdictional regulation for this procedure was laid down in the Qishu jinyin didang fa 契書金銀抵當法 "Law on certificates, securities and pawns" and the Jiebao sheqing fa 結保賒請法 "Joint-pledge law".
The market exchange office had the duty to lower prices to an acceptable level and to regulate demand and supply. It thus bought up the guilds' commodities at a higher price and sold them at lower prices and thus critically disrupted the price games of the monopolist merchant guilds. For this purpose, the central government invested million min 緡 "strings" of copper cash from the central treasury and 870,000 min from the metropolitan treasury as "government capital" (guanben 官本) to purchase commodities when prices were cheap and to throw them at a higher price on the market when prices were favouable. In the end, the government acted as an entrepreneur.
The idea for this procedure was not new and had forerunners in Sang Hongyang's 桑弘羊 (152-80 BCE) "price-stabilization law" (pingzhunfa 平準法) from the Former Han period 前漢 (206 BCE-8 CE). Yet while at that time government officials directly took over the merchandising, Wang Anshi's law just provided that the government took control over marketing activities by forcibly binding them to a regulating institution. The Song period method also included credit transactions, which had played no role in Sang Hongyang's concept.
Apart from ending the monopolist position of many a merchant company, Wang Anshi's law also helped the government to cut expenditure for items purchased by the state. After his downfall in 1085 the law continued, but the character of the market exchange bureaus changed drastically to one by which the government purchased at low prices and sold at higher ones. The bureaus were renamed price-stabilization bureaus (pingzhunwu 平準務) in 1100, yet the Southern Song 南宋 (1127-1279) discontinued the system.