Optimal hematocrit $H_o$ maximizes oxygen transport. In healthy humans, the average hematocrit $H$ is in the range of 40-45$%$, but it can significantly change in blood pathologies such as severe anemia (low $H$) and polycythemia (high $H$). Whether the hematocrit level in humans corresponds to the optimal one is a long standing physiological question. Here, using numerical simulations with the Lattice Boltzmann method and two mechanical models of the red blood cell (RBC) we predict the optimal hematocrit, and explore how altering the mechanical properties of RBCs affects $H_o$. We develop a simplified analytical theory that accounts for results obtained from numerical simulations and provides insight into the physical mechanisms determining $H_o$. Our numerical and analytical models can easily be modified to incorporate a wide range of mechanical properties of RBCs as well as other soft particles thereby providing means for the rational design of blood substitutes. Our work lays the foundations for systematic theoretical study of the optimal hematocrit and its link with pathological RBCs associated with various diseases (e.g. sickle cell anemia, diabetes mellitus, malaria, elliptocytosis).