We predict the mass fraction of oxygen lost from galaxies in a cosmological simulation as a function of stellar mass and environment at the present day. The distribution with stellar mass is bimodal, separating star-forming and quenched galaxies. The metallicity of gas and stars is self-consistently calculated using a chemical evolution model that includes supernovae type II and Ia, hypernovae, and asymptotic giant branch stars. The mass of oxygen lost from each galaxy is calculated by comparing the existing oxygen in gas and stars in the galaxy to the oxygen that should have been produced by the present-day population of stars. More massive galaxies are able to retain a greater fraction of their metals (∼ 100 per cent) than low-mass galaxies (∼ 40 − 70 per cent). As in the star formation main sequence, star-forming galaxies follow a tight relationship also in terms of oxygen mass lost -a metal flow main sequence, ZFMS -whereas massive quenched galaxies tend to have lost a greater fraction of oxygen (up to 20 per cent), due to AGN-driven winds. The amount of oxygen lost by satellite galaxies depends on the details of their interaction history, and those in richer groups tend to have lost a greater fraction of their oxygen. Observational estimates of metal retention in galaxies will provide a strong constraint on models of galaxy evolution.