Liu Yan (; 715/716Liu Yan's biography in the Old Book of Tang indicated that he was 66 when he died, while his biography in the New Book of Tang indicated that he was 65 when he died. Compare Old Book of Tang, vol. 123 and New Book of Tang, vol. 149. However, it should also be further noted that according to his biography in the Old Book of Tang, he was seven when he was made a scribe, while in the New Book of Tang, he was said to be eight – and it was further said that it occurred at the time that Emperor Xuanzong offered sacrifices at Mount Tai, which was in 725. If the latter were accurate, he would have been born in 718. – August 12, 780The date is based on the assertion in Liu Yan's biography in the New Book of Tang that he died 19 days before the edict ordering him to commit suicide, which was issued on August 31, according to the Zizhi Tongjian. See New Book of Tang, vol. 149 and Zizhi Tongjian, vol. 226.), courtesy name Shi'an (), was a Chinese economist and politician during the Tang dynasty who served briefly as chancellor during the reign of Emperor Daizong – but who was more known for his reforms in the Tang salt monopoly and food transportation systems, credited with allowing the Tang economy to recover after the disastrous An Lushan Rebellion. In 780, during the reign of Emperor Daizong's son Emperor Dezong, after the chancellor Yang Yan made a series of false accusations against him, he was first demoted and then executed.
Background Liu Yan was born in 715 or 716. His family was from Cao Prefecture (曹州, in modern Heze, Shandong), and traced its ancestry to Liu Jiao (), a younger brother of Han dynasty's founder Emperor Gao. His great-great-grandfather Liu Jin () served as a county magistrate during Tang dynasty's predecessor Sui dynasty, and his great-grandfather Liu Yu () served as an imperial scholar early in Tang. His grandfather Liu Gong () served as a county magistrate, while his father Liu Zhihui () served as a county secretary general.New Book of Tang, vol. 71.1.
During Emperor Xuanzong's reign When Emperor Xuanzong offered sacrifices at Mount Tai in 725, Liu Yan, then a child, wrote a song and submitted it to Emperor Xuanzong. Emperor Xuanzong was amazed, and he had his chancellor Zhang Yue test Liu's knowledge. Zhang was also impressed and stated, "This is a sign of fortune for the empire." He made Liu a scribe in the imperial government, at his young age, and Liu became referred to as the "godly child."New Book of Tang, vol. 149. The honored men all rushed to invite him to their households.
During Emperor Xuanzong's Tianbao era (742–756), Liu became the magistrate of Xia County (夏縣, in modern Yuncheng, Shanxi). Xia County was a key point for transportation of supplies to the Tang capital Chang'an, and it was said that while Liu did not supervise the transportation of supplies through his county in a harsh manner, the supplies were nevertheless always on time. After receiving a recommendation, he was then made the magistrate of Wen County (溫縣, in modern Jiaozuo, Henan). It was said that the people were happy about his governance and made monuments for him. He was later recalled to Chang'an to serve as Shiyushi (), a low-level imperial censor.
During Emperor Suzong's reign In 755, the general An Lushan rebelled at Fanyang and by 756, the forces of his new state of Yan were approaching Chang'an, forcing Emperor Xuanzong to flee to Chengdu. Liu Yan fled to Xiangyang. Emperor Xuanzong's son and crown prince Li Heng fled to Lingwu instead, where he was declared emperor (as Emperor Suzong), an act that Emperor Xuanzong recognized. Emperor Xuanzong, however, prior to Emperor Suzong's declaration as emperor, had sent another son, Li Lin the Prince of Yong, to Jianling to oversee the Yangtze River region. When Li Lin arrived at Jiangling, he heard that Liu was at Xiangfan and invited him to serve on his staff. Liu declined, however, and wrote a letter to the chancellor Fang Guan, pointing out that at this point, having imperial princes with great powers would simply bring trouble. Emperor Suzong then issued an edict making Liu the tax collector for the Yangtze-Huai River region. When Liu reached Wu Commandery (roughly modern Suzhou, Jiangsu), he heard that Li Lin had rebelled against Emperor Suzong, and therefore met with the surveyor of the region, Li Xiyan (), to confer on how to resist Li Lin. Li Xiyan put Liu in defense of Yuhang Commandery (餘杭, roughly modern Hangzhou, Zhejiang). After Li Xiyan was defeated by Li Lin late in 756, he fled to Yuhang and defended it together with Liu. In 757, after Li Lin was defeated by other Tang generals, he initially considered attacking Yuhang, but after hearing that Liu was defending it, he changed his mind and fled west. (He was eventually captured and killed by another Tang general, Huangfu Shen () Liu, however, did not claim credit for the victory. At a later point, Emperor Suzong recalled him to serve as the governor of Pengyuan Commandery (彭原, roughly modern Qingyang, Gansu). He later served as the prefect of Hua Prefecture (華州, in modern Weinan, Shaanxi), and then the mayor of Henan Municipality (), which encompassed the eastern capital Luoyang. However, as at that time Tang forces were still stalemated against the Yan emperor by that point, Shi Chaoyi (the son of An Lushan's general Shi Siming), and Luoyang was still in Yan hands, Liu's government seat was actually at Changshui (長水, near Luoyang).
Liu had already proved his worth by using impressed labor to dredge the long silted-over canal connecting the Huai and Yellow rivers; this project lowered transport costs, relieved food shortages, and increased tax revenues with little government investment. The Huai river ran through Northern Jiangsu, the location of coastal salt marshes which were the major source of salt. Liu realized that if the government could control these areas to enforce a salt monopoly, such as had existed in earlier periods but fallen into disuse, it could sell the salt at a monopoly price to merchants, who would pass the increased price on to their customers. This monopoly price was an indirect tax which was reliably collected in advance without having to control the areas where the salt was consumed. In 758 Liu created a Salt and Iron Commission whose revenues were particularly important since the central government had lost control of the provinces. Even better, the revenue originated in the south, where it could be safely used to buy grain to ship to the capital, Chang'an, by river and canal.Samuel Adrian M. Adshead. T'ang China: The Rise of the East in World History. (New York: Palgrave Macmillan, 2004; ), p. 50.
By 760, Liu Yan was serving as the mayor of Jingzhao Municipality (), which encompassed Chang'an, when he, because he was believed to be capable in financial matters, was also made the deputy minister of census (戶部侍郎, Hubu Shilang), as well as the special director in charge of finance, minting, and salt and iron monopolies. It was said that in these positions, Liu was not harsh but had a good grasp of the big picture, and that he served well.
In 761, the official Yan Zhuang (), who had previously served An but later submitted to Tang, was accused of having secret communications with Shi Chaoyi. After Yan was arrested, Liu sent soldiers to guard Yan's mansion, ready to seize it if Yan were found guilty. Yan, however, was soon exonerated, and became resentful of Liu. Yan therefore accused Liu of leaking contents of secret conversations that he had with Emperor Suzong. As a result of these counteraccusations, and also because the chancellor Xiao Hua was jealous of Liu's talents, both Liu and Yan were demoted — in Liu's case, to be the prefect of Tong Prefecture (通州, in modern Dazhou). His financial responsibilities were transferred to Yuan Zai.
During Emperor Daizong's reign Emperor Suzong died in 762 and was succeeded by his son Emperor Daizong. Emperor Daizong recalled Liu Yan to Chang'an to again serve in three posts – deputy minister of census, mayor of Jingzhao Municipality, and special director in charge of finance, minting, salt and iron monopolies, and food shipments. Liu declined the posts of deputy minister of census and mayor of Jingzhao, yielding them to Yan Zhenqing and Yan Wu () respectively. In 763, while still serving as special director of the various economy-related matters, he was also made the minister of civil service affairs (libu shangshu 吏部尚書) and given the designation "Jointly Manager of Affairs with the Secretariat-Chancellery" (tong zhongshu menxia pingzhang shi ), a cumbersome title indicating his participation in central government deliberations as de facto chancellor. In 764, however, he was accused of having close association with the eunuch Cheng Yuanzhen – who had been exceedingly powerful but who had been removed in 763 after he was blamed for not warning Emperor Daizong about a Tufan invasion – and he, along with a colleague who had been hated by other eunuchs for his role in Cheng's downfall, Li Xian, were removed from their chancellor posts, with Liu being made a member of the staff of Li Kuo the Crown Prince.
The system of monopoly on salt would by 780 help provide more than half of the entire cash revenue of the empire. While his reforms on grain transport helped reduce a significant cost to the empire. His liangshuifa (two-tax system) consolidated and collected property and land tax twice-annually which greatly increased state revenue.
However, later in the year, Liu was put in charge of the affairs of food shipments, taxation, salt and iron monopolies, and food management for the regions of Luoyang, Huai River, and Yangtze River. At that time, the Chang'an region was suffering from a food shortage, after years of warfare. Food supplies coming from the Yangtze region, which had been traveling through Bian River – a canal that connected the Huai River and Yellow River – prior to the Anshi Rebellion, had been unable to travel through it since it had been silted through the years. Instead, the shipments had to travel on the Yangtze River and Han River to Liang Prefecture (梁州, in modern Hanzhong, Shaanxi), and then over the Qinling Mountains to Chang'an – a much more treacherous and costly route. Liu, hoping to restore the Bian River-Yellow River route, personally travelled through the former route to examine it. He then wrote a detailed report to Yuan Zai,Old Book of Tang, vol. 123. who had become a powerful chancellor by that point, explaining the benefits of the Bian River route. With Yuan's support, he began the project to clear Bian River of silt. Upon the completion of the project, the food supplies for the Chang'an regions became plentiful, even during times of poor harvest. Emperor Daizong, complimenting him, stated, "You, lord, are my Marquess of Zuan" — comparing him to the great Han dynasty prime minister Xiao He. By 766, Liu was serving as the minister of census (戶部尚書, Hubu Shangshu), and that year, the financial matters of the state were divided in halves — with him in charge of the eastern half of the empire, and his deputy Diwu Qi in charge of the western half.