We model a credit network characterized by credit relationships connecting (i) downstream (D) and upstream (U) firms and (ii) firms and banks. The net worth of D firms is the driver of fluctuations. The production of D firms and of their suppliers (U firms) in fact, is constrained by the availability of internal finance--proxied by net worth--to the D firms. The structure of credit interlinkages changes over time due to an endogeneous process of partner selection, which leads to the polarization of the network. At the aggregate level, the distribution of growth rates exhibits negative skewness and excess kurtosis. When a shock hits the macroeconomy or a significant group of agents in the credit network a bankruptcy avalanche can follow if agents' leverage is critically high. In a nutshell we want to explore the properties of a network-based financial accelerator.