on trade come from the intensive and the extensive margins of trade. Importantly, we carefully investigate the endogeneity of trade and deep RTAs through different methods. We use an Instrumental Variable approach based on the domino effect of RTAs (Baldwin and Jaimovich, 2012), a plausible exogeneity test à la Conley et al. (2012), and we employ an event study approach to check the parallel trend assumption and confirm the validity of the key results.

To assess the impact of deep RTAs on the export performances of firms, we adapt the standard gravity model for trade (Head and Mayer, 2014) to firm-level analysis and include a variable capturing the depth of RTAs. Using information from the Deep Trade Agreements database, we construct different measures of RTA depth based on the policy areas covered by the agreements and their legal enforceability. Our specification allows to identify the impact on firms’ exports of a _change_ in the depth of RTAs (i.e. newly signed RTAs or amendment of preexisting ones) between two countries, controlling for any firm-year and country-specific factor that may affect the export performance of firms. The baseline results show that one additional legally enforceable policy area in RTAs boosts the exports of firms by 0.3%; corresponding to a 3.6% increase in firms’ exports when moving from _shallow_ to _deep_ RTAs.<sup>1</sup> This effect is larger for policy areas in RTAs that are not regulated by the agreements of the World Trade Organization (WTO-extra), such as investment or competition. One additional legally enforceable WTOextra provision increases the firm’s exports by 0.7%. The instrumental variable approach and the plausible exogeneity test both suggest the causal interpretation of our results.

This average effect of deep RTAs on the export performance of firms may hide substantial heterogeneity across firms with different characteristics. In New New Trade Theory models à la Melitz (2003) firms are heterogeneous and a reduction in fixed and/or variable export cost is expected to favor exports of large and highly productive firms at the expenses of low-productivity firms, leading to a selection effect. This selection effect is magnified in presence of heterogeneous demand elasticity: if large and more productive firms face smaller demand elasticity and higher mark-ups, the pro-competitive effect induced by deep RTAs exacerbates the reduction in foreign sales of less productive firms (in line with Atkeson and Burstein 2008 and Crowley et al. 2022). Our second set of estimations tests the effect of deep RTAs on heterogeneous exporters.<sup>2</sup> In line with the findings of the New New Trade Theory, we uncover strong heterogeneous effects of deep RTAs on firms with different characteristics. While large and high-productivity firms benefit from deep RTAs, small and less productive firms suffer the increased competition

> 1We consider _shallow_ those RTAs including only the two tariff related provisions that are always included in RTAs (i.e. tariff cut on agriculture and industrial sectors), and _deep_ those RTAs including 14 provisions (i.e. the 75 percentile in the depth of RTAs).

> 2For our large sample of developing countries, we do not have data on the balance sheet of firms to compute direct measures of productivity, so we resort to several proxies discussed in detail in section 5.2.

2