Carbonate melts have been proposed to exist in the lower mantle, but their interaction with other lower mantle melt compositions is poorly understood. To understand miscibility in the carbonate-silicate-metal melt system, we simulate endmember, binary, and ternary melt mixtures and study how their Gibbs free energies of mixing evolve with pressure. We find that carbonate-metal and carbonate-silicate melts have miscibility gaps that close with increasing pressure, while silicate-metal melts are immiscible at all lower-mantle pressures. Extending this analysis to the core-mantle boundary, we suggest three miscible melt fields near the endmember carbonate, silicate, and iron melt compositions. Analysis of the densities of these miscible melt compositions indicates that some carbonate-rich and some silicate-rich melt compositions are gravitationally stable at the core-mantle boundary and could be candidate compositions to explain ultra-low velocity zones. Additionally, we evaluate the speciation of an example immiscible melt composition at various pressures throughout the mantle and identify reduced carbon species that would be expected to form in the melt. Our analysis reveals that a majority of Earth's carbon could have been transported to the core during core-mantle differentiation and that much of Earth's carbon may be stored in the deep interior today.