Galaxy clusters are the massive gravitationally bound structures in the universe. Studying this class of objects provides important information on the formation and evolution of large-scale structures and on the dark matter distribution. Weak gravitational lensing, a phenomenon related to the deflection of light by a massive object like a galaxy cluster can be used to estimate the mass distribution in galaxy clusters. In this talk, I present the weak lensing analysis of 279 galaxy clusters from the COnstrain Dark Energy with X-ray survey (CODEX), using imaging data from 4200 square degrees of the DECam Legacy Survey (DECaLS) Data Release 3. The cluster sample results from a joint selection in X-ray, optical richness in the range 20 ≤ λ < 110, and redshift in the range 0.1 ≤ z ≤ 0.2. I model the cluster mass (M200c) and the richness relation. By measuring the CODEX cluster sample as an individual cluster, I obtain the best-fitting values and the richness scaling index, consistent with a power-law relation. Moreover, I separate the cluster sample into three richness groups; λ = 20–30, 30–50, and 50–110, and measure the stacked excess surface mass density profile in each group. The results show that both methods are consistent. In addition, I find a good agreement between the weak lensing-based scaling relation and the relation obtained with dynamical masses estimated from cluster member velocity dispersions measured by the SDSS-IV/SPIDERS team. This suggests that the cluster dynamical equilibrium assumption involved in the dynamical mass estimates is statistically robust for a large sample of clusters.