Densities from relativistic mean field calculations are applied to construct the optical potential and, hence calculate the endpoint of the rapid proton capture (rp) process. Mass values are taken from a new phenomenological mass formula. Endpoints are calculated for different temperature-density profiles of various X-ray bursters. We find that the rp process can produce significant quantities of nuclei upto around mass 95. Our results differ from existing works to some extent.