Hagia Sophia Almshouse, northeast of Hagia Sophia, was built in 1742-1743 by the sultan of Mahmut I. The front entrance of the imaret, III. Ahmet Fountain, between the soup kitchen courtyard and Hagia Sophia, there is the Treasury Department, which is a Byzantine structure. This round and domed structure is known as the place where the sacred objects used in religious education are kept in Eastern Rome. According to a light structure in the century V. and VI. production continues. Beginning from the reign of Mahmut I, to be kept as merchandising and in this way in the XIX. his son continued until the quarter. After this period, it served as an archive building for a while.
Almshouse was repaired in 1777, 1871, 1884, 1893, after 1920 as the archive warehouse of the General Directorate of Foundations and subsequently as a lead workshop. Today it is used as the Carpet Museum.