Not €40m but more like €60m according to globoesporte.
https://ge.globo.com/futebol/times/palmeiras/noticia/2022/07/21/endrick-assina-primeiro-contrato-com-o-palmeiras.ghtml
I think Edwards played a bigger role than Klopp at Pool. He was the one who convinced Klopp to agree with Mane and Salah despite the later wanted Brandt, Gotze, and Pulisic.