Title: A model of financial intermediation and its applications