This paper considers the stability of a financial system in which heterogenous banks interact through a lending market. We analyse a discrete time model in which households and banks are located on a circular city. Households present banks with risky investment opportunities, which banks fund through deposits and interbank borrowing. In the event of bankruptcy, a bank defaults on its interbank loans potentially resulting in contagion and losses for other banks. Through simulation we examine the vulnerability of the financial system to systemic events, demonstrating the non-linear relationship between market concentration, shock severity and bankruptcies. The role and effect of regulatory actions such as reserve requirements, minimum bank capitalisation and constraints on the size of borrowing relationships, are considered in limiting these effects.