This paper presents a dynamic programming model that reduces the cost of issuing a mortgage-backed security by changing the structure of the security issued. The implementation is built on the jMDP framework, which solves Markov Decision Problems. The model was implemented in a real life instance, using the original data of the seventh issuance of the Colombian securitizing firm, Titularizadora Co-lombiana (a Fannie Mae alike), which allowed us to determine the different levels of improvement attained by the model.