In this paper, we identify and quantify the importance of endogenous peer effects in the interbank market, allowing for varying degrees of intensity of these peer effects. We base our analysis on a unique dataset that includes all interbank loans that have taken place between 15 banks in the Chilean interbank market representing more than 95% of the market between 2009 and 2016. This approach contrasts sharply with the geographical definition of peers used by most of the literature. As an application of our model, we examine an episode of liquidity shortage experienced by one Chilean bank in the interbank market, with the lenses of our model. We show evidence consistent with a herding behavior of the lender banks which, according to our model, were peers of the stressed bank.