Abstract: This study addresses a critical regulatory shortfall by developing a platform to extend stress testing from a microprudential approach to a dynamic, macroprudential approach. This paper describes the ensuing agent-based model for analyzing the vulnerability of the financial system to asset- and funding-based fire sales. The model captures the dynamic interactions of agents in the financial system extending from the suppliers of funding through the intermediation and transformation functions of the bank/dealers to the financial institutions that use the funds to trade in the asset markets. The model replicates the key finding that it is the reaction to initial losses, rather than the losses themselves, that determine the extent of a crisis. By building on a detailed mapping of the transformations and dynamics of the financial system, the agent-based model provides an avenue toward risk management that can illuminate the pathways for the propagation of key crisis dynamics such as fire sales and funding runs.