This paper introduces an innovative approach to identifying and estimating the parameters of interest in the widely recognized linear-in-means regression model under conditions where the initial randomization of peers determines the observed network. We assert that peers who are initially randomized do not produce social effects. However, after randomization, agents can endogenously develop significant connections that potentially generate peer influences. We present a moment condition that compiles local heterogeneous identifying information for all agents within the population. Under the assumption of $\psi$-dependence in the endogenous network space, we propose a Generalized Method of Moments (GMM) estimator, which is proven to be consistent, asymptotically normally distributed, and straightforward to implement using commonly available statistical software due to its closed-form expression. Monte Carlo simulations demonstrate the GMM estimator’s strong small-sample performance. An empirical analysis utilizing data from Hong Kong high school students reveals substantial positive spillover effects on math test scores among study partners in our sample, provided that their seatmates were exogenously assigned by their teachers.