Substitutes markets with budget constraints: solving for competitive and optimal prices Preprint in arXiv (October 2023)