We develop and calibrate a model where differences in factor endowments lead countries to trade intermediate goods, and gains from trade reflect in total factor productivity. We perform several output and growth decompositions, to assess the impact that barriers to trade, as well as changes in terms of trade, have on measured TFP. We find that for very poor economies gains from trade are large, in some cases representing a doubling of GDP. Also, that an improvement in the terms of trade - by allowing the use of a better mix of intermediate inputs in the production process - translates into productivity growth.