In this paper, the efficiency of an outdoor pilot-scale raceway pond treating the wastewaters generated by a large-scale piggery farm in Northern Italy was evaluated. The biomass productivity over the 208 days of experimentation was 10.7 ± 6.5 g TSS·m -2·d -1, and ammoniacal nitrogen, orthophosphate, and COD average removal efficiencies were 90%, 90%, and 59%, respectively. These results were used to carry out a comprehensive techno-economic analysis for the integration of algae-based processes in farms of different sizes (100 – 10000 pigs). Based on this evaluation, the amount of N disposed of on agricultural land can be reduced from 91% to 21%, increasing the fraction returned to the atmosphere from 2.4% to 63%, and the fraction in the biomass from 6.2% to 16%. In the case of intensive farming, the release of 110 t N·ha -1·y -1 contained in the liquid fraction of the digestate could be avoided by including algae-bacteria processes in the farm layout. The biomass production cost was as low as 3.4 \euro·kg -1, while the cost for nitrogen removal was 7.6 \euro·kg N -1.