We study the system of heterogeneous lending and borrowing based on the relative average of log-capitalization given by the linear combination of the average within groups and ensemble average. Moreover, we describe the evolution of log-capitalization by using a system of coupled diffusions. The model incorporates a game feature with homogeneity within groups and heterogeneity among groups where banks search for the optimal strategies for lending to or borrowing from a central bank by minimizing the heterogeneous linear quadratic costs to avoid approaching the default barrier. The importance of relative concerns causes the relative ensemble average to be the critical determinant for lending and borrowing. The existence of closed- and open-loop Nash equilibria for the two-group case is validated by the solvability for the coupled Riccati equations. Both equilibria comprise the mean-reverting terms identical to the homogeneous game and all group averages owing to heterogeneity. The comparison of the obtained open- and closed-loop Nash equilibria is discussed. Furthermore, the existence of an approximate Nash equilibrium of the mean field games in the general d heterogeneous groups is verified. Finally, in financial implications, we study the influence of the incentive and relative parameters and also the number of banks on the corresponding liquidity rates through numerical analysis.