Endogenous Money: An Analytical Approach